Module: Features::ClearanceHelpers
- Defined in:
- lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb
Instance Method Summary collapse
- #reset_password_for(email) ⇒ Object
- #sign_in_with(email, password) ⇒ Object
- #sign_out ⇒ Object
- #sign_up_with(email, password) ⇒ Object
- #signed_in_user ⇒ Object
- #user_should_be_signed_in ⇒ Object
- #user_should_be_signed_out ⇒ Object
- #user_with_reset_password ⇒ Object
Instance Method Details
#reset_password_for(email) ⇒ Object
43 44 45 46 47 |
# File 'lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb', line 43 def reset_password_for(email) visit new_password_path fill_in 'password_email', :with => email I18n.t('helpers.submit.password.submit') end |
#sign_in_with(email, password) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb', line 10 def sign_in_with(email, password) visit sign_in_path fill_in 'session_email', :with => email fill_in 'session_password', :with => password I18n.t('helpers.submit.session.submit') end |
#sign_out ⇒ Object
29 30 31 |
# File 'lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb', line 29 def sign_out click_link I18n.t('layouts.application.sign_out') end |
#sign_up_with(email, password) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb', line 3 def sign_up_with(email, password) visit sign_up_path fill_in 'user_email', :with => email fill_in 'user_password', :with => password I18n.t('helpers.submit.user.create') end |
#signed_in_user ⇒ Object
17 18 19 20 21 22 |
# File 'lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb', line 17 def signed_in_user password = 'password' user = create(:user, :password => password) sign_in_with user.email, password user end |
#user_should_be_signed_in ⇒ Object
24 25 26 27 |
# File 'lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb', line 24 def user_should_be_signed_in visit root_path page.should have_content I18n.t('layouts.application.sign_out') end |
#user_should_be_signed_out ⇒ Object
33 34 35 |
# File 'lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb', line 33 def user_should_be_signed_out page.should have_content I18n.t('layouts.application.sign_in') end |
#user_with_reset_password ⇒ Object
37 38 39 40 41 |
# File 'lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb', line 37 def user_with_reset_password user = create(:user) reset_password_for user.email user.reload end |