Module: Spree::TestingSupport::AuthHelpers
- Defined in:
- lib/spree/testing_support/auth_helpers.rb
Instance Method Summary collapse
- #log_in(email:, password:, remember_me: true) ⇒ Object
- #log_out ⇒ Object
- #show_user_account ⇒ Object
- #show_user_menu ⇒ Object
Instance Method Details
#log_in(email:, password:, remember_me: true) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/spree/testing_support/auth_helpers.rb', line 4 def log_in(email:, password:, remember_me: true) visit spree.login_path fill_in 'Email', with: email fill_in 'Password', with: password # Regression test for #1257 first('label', text: 'Remember me').click if remember_me 'Log in' expect(page).to have_content 'Logged in successfully' end |
#log_out ⇒ Object
17 18 19 20 21 22 |
# File 'lib/spree/testing_support/auth_helpers.rb', line 17 def log_out click_link 'LOG OUT' expect(page).to have_content 'Signed out successfully' end |
#show_user_account ⇒ Object
28 29 30 31 32 33 |
# File 'lib/spree/testing_support/auth_helpers.rb', line 28 def show_user_account within '#nav-bar' do click_link 'MY ACCOUNT' end end |
#show_user_menu ⇒ Object
24 25 26 |
# File 'lib/spree/testing_support/auth_helpers.rb', line 24 def find("button[aria-label='Show user menu']").click end |