@@ -31,11 +31,13 class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base | |||
|
31 | 31 | def test_api_should_trigger_basic_http_auth_with_basic_authorization_header |
|
32 | 32 | ApplicationController.any_instance.expects(:authenticate_with_http_basic).once |
|
33 | 33 | get '/users/current.xml', {}, credentials('jsmith') |
|
34 | assert_response 401 | |
|
34 | 35 | end |
|
35 | 36 | |
|
36 | 37 | def test_api_should_not_trigger_basic_http_auth_with_non_basic_authorization_header |
|
37 | 38 | ApplicationController.any_instance.expects(:authenticate_with_http_basic).never |
|
38 | 39 | get '/users/current.xml', {}, 'HTTP_AUTHORIZATION' => 'Digest foo bar' |
|
40 | assert_response 401 | |
|
39 | 41 | end |
|
40 | 42 | |
|
41 | 43 | def test_invalid_utf8_credentials_should_not_trigger_an_error |
General Comments 0
You need to be logged in to leave comments.
Login now