Created
October 4, 2016 20:09
-
-
Save ethagnawl/2f0f4ac9667c1ce143b868cb5a5491a9 to your computer and use it in GitHub Desktop.
capybara poltergeist http basic authentication
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
def authenticate_with_http_basic(username, password) | |
basic = ActionController::HttpAuthentication::Basic | |
credentials = basic.encode_credentials(username, password) | |
page.driver.headers = {'Authorization' => credentials} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment