aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-06-01 12:41:18 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-06-01 12:41:18 -0300
commitcf484e3ee3f5935e41fed1a93b2ab069d9e4f969 (patch)
treec23ae5cc5dbf2d43cbfb968079280e31eb81cd87 /actionpack/test
parent4e63bde623a0478ec55bcbfbe1afd8b4938148c8 (diff)
parent4d4440c5a86fc1611b0a236b3253aa3339366788 (diff)
downloadrails-cf484e3ee3f5935e41fed1a93b2ab069d9e4f969.tar.gz
rails-cf484e3ee3f5935e41fed1a93b2ab069d9e4f969.tar.bz2
rails-cf484e3ee3f5935e41fed1a93b2ab069d9e4f969.zip
Merge pull request #19094 from phoet/have_bearer_be_valid_as_well
Have Bearer be valid as well
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/http_token_authentication_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/test/controller/http_token_authentication_test.rb b/actionpack/test/controller/http_token_authentication_test.rb
index 2521f0322c..802c17b6bf 100644
--- a/actionpack/test/controller/http_token_authentication_test.rb
+++ b/actionpack/test/controller/http_token_authentication_test.rb
@@ -80,13 +80,20 @@ class HttpTokenAuthenticationTest < ActionController::TestCase
end
test "authentication request with badly formatted header" do
- @request.env['HTTP_AUTHORIZATION'] = "Token foobar"
+ @request.env['HTTP_AUTHORIZATION'] = 'Token token$"lifo"'
get :index
assert_response :unauthorized
assert_equal "HTTP Token: Access denied.\n", @response.body, "Authentication header was not properly parsed"
end
+ test "successful authentication request with Bearer instead of Token" do
+ @request.env['HTTP_AUTHORIZATION'] = 'Bearer lifo'
+ get :index
+
+ assert_response :success
+ end
+
test "authentication request without credential" do
get :display