Created
January 30, 2018 14:05
-
-
Save isuke/e353e723432832b0f41dcd2cb1a75e71 to your computer and use it in GitHub Desktop.
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
| # spec/support/session_helper.rb | |
| module SessionHelper | |
| def login(user, with_capybara: false) | |
| if with_capybara | |
| page.driver.remove_cookie('user_credentials') | |
| page.driver.set_cookie('user_credentials', "#{user.persistence_token}::#{user.id}") | |
| else | |
| cookies['user_credentials'] = "#{user.persistence_token}::#{user.id}" | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment