From 7c51ec074278dceee2d4b01f67034114d61ba9f2 Mon Sep 17 00:00:00 2001 From: Pelle Braendgaard Date: Mon, 13 Sep 2010 18:44:38 +0800 Subject: [PATCH] Improved test thanks to Jose Valim. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- test/integration/http_authenticatable_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration/http_authenticatable_test.rb b/test/integration/http_authenticatable_test.rb index fd4466fd..8ac5960f 100644 --- a/test/integration/http_authenticatable_test.rb +++ b/test/integration/http_authenticatable_test.rb @@ -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 \ No newline at end of file