2014-03-23 00:22:25 +00:00
|
|
|
module Features
|
|
|
|
module SessionHelpers
|
2015-11-08 09:41:11 +00:00
|
|
|
def sign_in_as(user)
|
2014-03-23 00:22:25 +00:00
|
|
|
visit root_path
|
2014-03-30 19:50:52 +00:00
|
|
|
|
|
|
|
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")
|
2014-04-01 23:07:21 +00:00
|
|
|
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")
|
2014-04-01 23:07:21 +00:00
|
|
|
find("option[value='#{timezone}']").select_option
|
2015-11-08 09:41:11 +00:00
|
|
|
|
|
|
|
click_button I18n.t("helpers.submit.user.update")
|
2014-03-23 00:22:25 +00:00
|
|
|
end
|
2014-04-17 07:55:19 +00:00
|
|
|
|
|
|
|
def user_status
|
|
|
|
find "#authentication"
|
|
|
|
end
|
|
|
|
|
|
|
|
def registration_form
|
|
|
|
find "#new_user"
|
|
|
|
end
|
2014-03-23 00:22:25 +00:00
|
|
|
end
|
2015-11-08 09:41:11 +00:00
|
|
|
end
|