Module: AuthenticationHelper

Defined in:
lib/generators/jinda/templates/spec/support/authentication_helper.rb

Instance Method Summary collapse

Instance Method Details

#create_and_sign_in_userObject



10
11
12
13
14
# File 'lib/generators/jinda/templates/spec/support/authentication_helper.rb', line 10

def 
  user = FactoryBot.create(:user)
  (user)
  user
end

#current_ma_userObject

from Jinda::Helpers



17
18
19
20
# File 'lib/generators/jinda/templates/spec/support/authentication_helper.rb', line 17

def current_ma_user
  @user ||= User.where(auth_token: user.auth_token)
  @user
end

#sign_in(user) ⇒ Object

controller return 1. Session 2. Cookies ==> user.id



5
6
7
8
# File 'lib/generators/jinda/templates/spec/support/authentication_helper.rb', line 5

def (user)
  @user = user
  current_ma_user
end