Improved test thanks to Jose Valim.

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Pelle Braendgaard
2010-09-13 18:44:38 +08:00
committed by José Valim
parent ed05225dd5
commit 7c51ec0742

View File

@@ -57,7 +57,8 @@ class HttpAuthenticationTest < ActionController::IntegrationTest
# Sign in with oauth2 token. This is just to test that it isn't misinterpreted as basic authentication
def add_oauth2_header
get users_path(:format => :xml), {}, "HTTP_AUTHORIZATION" => "OAuth #{ActiveSupport::SecureRandom.base64}"
user = create_user
get users_path(:format => :xml), {}, "HTTP_AUTHORIZATION" => "OAuth #{ActiveSupport::Base64.encode64("#{user.email}:123456")}"
end
end