ensl.org/spec/support/features/session_helpers.rb

30 lines
631 B
Ruby
Raw Normal View History

module Features
module SessionHelpers
2015-11-08 09:41:11 +00:00
def sign_in_as(user)
visit root_path
fill_in "login_username", with: user.username
fill_in "login_password", with: user.raw_password
2015-11-08 09:41:11 +00:00
click_button I18n.t("helpers.submit.user.login")
end
def change_timezone_for(user, timezone)
visit edit_user_path(user.id)
2015-11-08 09:41:11 +00:00
click_link I18n.t("profile.locals")
find("option[value='#{timezone}']").select_option
2015-11-08 09:41:11 +00:00
click_button I18n.t("helpers.submit.user.update")
end
def user_status
find "#authentication"
end
def registration_form
find "#new_user"
end
end
2015-11-08 09:41:11 +00:00
end