Skip to content

Instantly share code, notes, and snippets.

@eliotsykes
Created July 24, 2015 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliotsykes/0171eb9b05b44afdece5 to your computer and use it in GitHub Desktop.
Save eliotsykes/0171eb9b05b44afdece5 to your computer and use it in GitHub Desktop.
# File: spec/support/login_helper.rb
module LoginHelper
def login(user)
visit new_user_session_path
fill_in 'Email', with: user.email
fill_in 'Password', with: user.password
click_button 'Log in'
expect(page).to have_content('Signed in successfully')
end
end
RSpec.configure do |config|
# Makes login(user) method available to feature specs:
config.include LoginHelper, type: :feature
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment