Module: MinimalistAuthentication::TestHelper

Defined in:
lib/minimalist_authentication/test_helper.rb

Constant Summary collapse

NEW_PASSWORD =
"abcdef123456"
PASSWORD =
"test-password"
PASSWORD_DIGEST =
BCrypt::Password.create(PASSWORD, cost: BCrypt::Engine::MIN_COST)

Instance Method Summary collapse

Instance Method Details

#current_userObject



9
10
11
# File 'lib/minimalist_authentication/test_helper.rb', line 9

def current_user
  @current_user ||= load_user_from_session
end

#login_as(user_fixture_name, password = PASSWORD) ⇒ Object



13
14
15
# File 'lib/minimalist_authentication/test_helper.rb', line 13

def (user_fixture_name, password = PASSWORD)
  post session_path, params: { user: { email: users(user_fixture_name).email, password: } }
end