From ad8c02ca825b471885b211cb158342d8b6bd975b 2014-02-22 15:55:20 From: Toshi MARUYAMA Date: 2014-02-22 15:55:20 Subject: [PATCH] add "assert_response 401" to tests (#16107) git-svn-id: http://svn.redmine.org/redmine/trunk@12917 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/integration/api_test/authentication_test.rb b/test/integration/api_test/authentication_test.rb index 92f7db6..5ec6a88 100644 --- a/test/integration/api_test/authentication_test.rb +++ b/test/integration/api_test/authentication_test.rb @@ -31,11 +31,13 @@ class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base def test_api_should_trigger_basic_http_auth_with_basic_authorization_header ApplicationController.any_instance.expects(:authenticate_with_http_basic).once get '/users/current.xml', {}, credentials('jsmith') + assert_response 401 end def test_api_should_not_trigger_basic_http_auth_with_non_basic_authorization_header ApplicationController.any_instance.expects(:authenticate_with_http_basic).never get '/users/current.xml', {}, 'HTTP_AUTHORIZATION' => 'Digest foo bar' + assert_response 401 end def test_invalid_utf8_credentials_should_not_trigger_an_error