Last active
August 10, 2023 17:48
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
module SessionSystemTestHelper | |
def sign_in_as(user) | |
visit root_url # any fast-to-load page will do | |
cookie_jar = ActionDispatch::TestRequest.create.cookie_jar | |
cookie_jar.signed[:session_token] = user.sessions.create.token | |
page.driver.browser.manage.add_cookie(name: "session_token", value: cookie_jar[:session_token], sameSite: :Lax, httpOnly: true) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For the initial page load you can use a blank html page, so it's as fast as possible.
Something like
visit root_url + "blank.html"
where blank.html is a file served from /public.