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



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

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

#current_ma_userObject

from Jinda::Helpers



14
15
16
17
# File 'lib/generators/jinda/templates/spec/support/authentication_helper.rb', line 14

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

#sign_in(user) ⇒ Object

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



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

def (user)
  @user = user
  current_ma_user
end