diff options
author | Zhang Kai Yu <yeannylam@gmail.com> | 2015-01-23 11:28:53 +0800 |
---|---|---|
committer | Zhang Kai Yu <yeannylam@gmail.com> | 2015-01-24 07:17:11 +0800 |
commit | 3e02cdc8727bbc6e44f63292da549d405c16865e (patch) | |
tree | fbd5eb7468e0328c1a82c14ecea14031e84b6395 /actionpack/test | |
parent | 8c83bd0732fc526e69cd5c348cb9d9842ae60c99 (diff) | |
download | rails-3e02cdc8727bbc6e44f63292da549d405c16865e.tar.gz rails-3e02cdc8727bbc6e44f63292da549d405c16865e.tar.bz2 rails-3e02cdc8727bbc6e44f63292da549d405c16865e.zip |
Add test for HTTP basic authentication when no credential is given.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/http_basic_authentication_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/http_basic_authentication_test.rb b/actionpack/test/controller/http_basic_authentication_test.rb index 9052fc6962..20962a90cb 100644 --- a/actionpack/test/controller/http_basic_authentication_test.rb +++ b/actionpack/test/controller/http_basic_authentication_test.rb @@ -83,6 +83,13 @@ class HttpBasicAuthenticationTest < ActionController::TestCase assert_response :unauthorized assert_equal "HTTP Basic: Access denied.\n", @response.body, "Authentication didn't fail for request header #{header} and long credentials" end + + test "unsuccessful authentication with #{header.downcase} and no credentials" do + get :show + + assert_response :unauthorized + assert_equal "HTTP Basic: Access denied.\n", @response.body, "Authentication didn't fail for request header #{header} and no credentials" + end end def test_encode_credentials_has_no_newline |