Extrude fill_in_auth_details
method to ProfileStories
spec support module (#31163)
This commit is contained in:
parent
6ad477d146
commit
95eadabe44
3 changed files with 12 additions and 18 deletions
|
@ -3,6 +3,12 @@
|
|||
module ProfileStories
|
||||
attr_reader :bob, :alice, :alice_bio
|
||||
|
||||
def fill_in_auth_details(email, password)
|
||||
fill_in 'user_email', with: email
|
||||
fill_in 'user_password', with: password
|
||||
click_on I18n.t('auth.login')
|
||||
end
|
||||
|
||||
def as_a_registered_user
|
||||
@bob = Fabricate(
|
||||
:user,
|
||||
|
@ -16,9 +22,7 @@ module ProfileStories
|
|||
def as_a_logged_in_user
|
||||
as_a_registered_user
|
||||
visit new_user_session_path
|
||||
fill_in 'user_email', with: email
|
||||
fill_in 'user_password', with: password
|
||||
click_on I18n.t('auth.login')
|
||||
fill_in_auth_details(email, password)
|
||||
end
|
||||
|
||||
def as_a_logged_in_admin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue