internetee-registry/spec/support/features/session_helpers.rb
Artur Beljajev 9684c8e59f Refactor Devise integration
- Use scoped users
- Use the named route helpers instead of hardcoded paths
2018-06-20 12:21:22 +03:00

26 lines
663 B
Ruby

module Features
module SessionHelpers
def sign_in_to_admin_area(user: create(:admin_user))
visit new_admin_user_session_url
fill_in 'admin_user[username]', with: user.username
fill_in 'admin_user[password]', with: user.password
click_button 'Log in'
end
def sign_in_to_registrar_area(user: create(:api_user))
visit new_registrar_user_session_url
fill_in 'depp_user_tag', with: user.username
fill_in 'depp_user_password', with: user.password
click_button 'Login'
end
def sign_in_to_registrant_area
user = create(:registrant_user)
sign_in(user, scope: :user)
end
end
end