class HttpAuthenticationTest

Private Instance Methods

add_oauth2_header() click to toggle source

Sign in with oauth2 token. This is just to test that it isn't misinterpreted as basic authentication

# File test/integration/http_authenticatable_test.rb, line 100
def add_oauth2_header
  user = create_user
  get users_path(format: :xml), {}, "HTTP_AUTHORIZATION" => "OAuth #{Base64.encode64("#{user.email}:12345678")}"
end
sign_in_as_new_user_with_http(username="user@test.com", password="12345678") click to toggle source
# File test/integration/http_authenticatable_test.rb, line 93
def sign_in_as_new_user_with_http(username="user@test.com", password="12345678")
  user = create_user
  get users_path(format: :xml), {}, "HTTP_AUTHORIZATION" => "Basic #{Base64.encode64("#{username}:#{password}")}"
  user
end