Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Created October 4, 2016 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethagnawl/2f0f4ac9667c1ce143b868cb5a5491a9 to your computer and use it in GitHub Desktop.
Save ethagnawl/2f0f4ac9667c1ce143b868cb5a5491a9 to your computer and use it in GitHub Desktop.
capybara poltergeist http basic authentication
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