Skip to content

Instantly share code, notes, and snippets.

@cbrunsdon
Created October 8, 2013 20:46
Show Gist options
  • Save cbrunsdon/6891350 to your computer and use it in GitHub Desktop.
Save cbrunsdon/6891350 to your computer and use it in GitHub Desktop.
authentication_helpers for rob
module AuthenticationHelpers
def sign_in_as!(user)
visit '/store/login'
fill_in 'Email', :with => user.email
fill_in 'Password', :with => 'secret'
click_button 'Login'
end
end
RSpec.configure do |c|
c.include AuthenticationHelpers, :type => :request
c.include AuthenticationHelpers, :type => :feature
end
given!(:user) { create :user }
background do
sign_in_as! user
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment