]> source.dussan.org Git - redmine.git/commitdiff
add "assert_response 401" to tests (#16107)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 22 Feb 2014 15:55:20 +0000 (15:55 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 22 Feb 2014 15:55:20 +0000 (15:55 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12917 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/api_test/authentication_test.rb

index 92f7db6848a060559a28a80b259332f1fbe2fbc2..5ec6a88247f0c9163cd982ec680cc0657913317a 100644 (file)
@@ -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