From ad8c02ca825b471885b211cb158342d8b6bd975b Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 22 Feb 2014 15:55:20 +0000 Subject: [PATCH] add "assert_response 401" to tests (#16107) git-svn-id: http://svn.redmine.org/redmine/trunk@12917 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/api_test/authentication_test.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/integration/api_test/authentication_test.rb b/test/integration/api_test/authentication_test.rb index 92f7db684..5ec6a8824 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