mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add test for HTTP basic authentication when no credential is given.
This commit is contained in:
parent
8c83bd0732
commit
3e02cdc872
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue