Module: AuthenticationHelper
- Defined in:
- lib/generators/jinda/templates/spec/support/authentication_helper.rb
Instance Method Summary collapse
- #create_and_sign_in_user ⇒ Object
-
#current_ma_user ⇒ Object
from Jinda::Helpers.
-
#sign_in(user) ⇒ Object
controller return 1.
Instance Method Details
#create_and_sign_in_user ⇒ Object
8 9 10 11 12 |
# File 'lib/generators/jinda/templates/spec/support/authentication_helper.rb', line 8 def create_and_sign_in_user user = FactoryBot.create(:user) sign_in(user) return user end |
#current_ma_user ⇒ Object
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 sign_in(user) @user = user current_ma_user end |