Module: Challah::Testing
- Included in:
- ActionController::TestCase
- Defined in:
- lib/challah/test.rb
Instance Method Summary collapse
-
#signin_as(user) ⇒ Object
(also: #login_as)
Sign the given user instance in.
-
#signout ⇒ Object
(also: #logout)
Sign the given user instance out.
Instance Method Details
#signin_as(user) ⇒ Object Also known as: login_as
Sign the given user instance in
30 31 32 |
# File 'lib/challah/test.rb', line 30 def signin_as(user) Session.create!(user, nil, nil, user.class) end |
#signout ⇒ Object Also known as: logout
Sign the given user instance out
36 37 38 |
# File 'lib/challah/test.rb', line 36 def signout Session.destroy end |