Created
October 8, 2013 20:46
-
-
Save cbrunsdon/6891350 to your computer and use it in GitHub Desktop.
authentication_helpers for rob
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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