Module: MinimalistAuthentication::TestHelper
- Defined in:
- lib/minimalist_authentication/test_helper.rb
Constant Summary collapse
- PASSWORD =
"test-password"
- PASSWORD_DIGEST =
BCrypt::Password.create(PASSWORD, cost: BCrypt::Engine::MIN_COST)
Instance Method Summary collapse
Instance Method Details
#current_user ⇒ Object
12 13 14 |
# File 'lib/minimalist_authentication/test_helper.rb', line 12 def current_user @current_user ||= load_user_from_session end |
#login_as(user_fixture_name, password = PASSWORD) ⇒ Object
8 9 10 |
# File 'lib/minimalist_authentication/test_helper.rb', line 8 def login_as(user_fixture_name, password = PASSWORD) post session_path, params: { user: { email: users(user_fixture_name).email, password: } } end |