2014-03-23 00:22:25 +00:00
|
|
|
module Features
|
|
|
|
module SessionHelpers
|
2014-03-30 19:50:52 +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
|
|
|
|
|
2014-04-01 23:07:21 +00:00
|
|
|
click_button I18n.t('helpers.submit.user.login')
|
|
|
|
end
|
|
|
|
|
|
|
|
def change_timezone_for(user, timezone)
|
|
|
|
visit edit_user_path(user.id)
|
|
|
|
|
|
|
|
click_link I18n.t('profile.locals')
|
|
|
|
find("option[value='#{timezone}']").select_option
|
|
|
|
|
|
|
|
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
|
|
|
|
end
|