-
-
Save anaerobeth/6803884 to your computer and use it in GitHub Desktop.
This file contains 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
# spec/support/authentication_helper.rb | |
module AuthenticationHelper | |
def sign_in_as(user) | |
visit new_user_session_path | |
fill_in "Email", with: user.email | |
fill_in "Password", with: user.password | |
click_button "Sign in" | |
expect(page).to have_link('Sign out') | |
end | |
end |
This file contains 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
require 'spec_helper' | |
feature "user edits their profile" do | |
scenario "some awesome description" do | |
user = FactoryGirl.create(:user) | |
sign_in_as user | |
# do stuff as a logged in user | |
end | |
end |
This file contains 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
# spec/spec_helper.rb | |
# ... omitted | |
RSpec.configure do |config| | |
# ... omitted | |
config.include AuthenticationHelper | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment