Created
March 6, 2013 11:39
-
-
Save djo/5098749 to your computer and use it in GitHub Desktop.
Speed up capybara specs by setting user session directly in the app.
To have access to the rack session use https://github.com/railsware/rack_session_access.
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
def fast_log_in | |
user = Factory.create(:user) | |
warden_key = User.serialize_into_session(user).unshift('User') | |
page.set_rack_session(:'warden.user.user.key' => warden_key) | |
user | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment