@@ -31,11 +31,13 class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base | |||||
31 | def test_api_should_trigger_basic_http_auth_with_basic_authorization_header |
|
31 | def test_api_should_trigger_basic_http_auth_with_basic_authorization_header | |
32 | ApplicationController.any_instance.expects(:authenticate_with_http_basic).once |
|
32 | ApplicationController.any_instance.expects(:authenticate_with_http_basic).once | |
33 | get '/users/current.xml', {}, credentials('jsmith') |
|
33 | get '/users/current.xml', {}, credentials('jsmith') | |
|
34 | assert_response 401 | |||
34 | end |
|
35 | end | |
35 |
|
36 | |||
36 | def test_api_should_not_trigger_basic_http_auth_with_non_basic_authorization_header |
|
37 | def test_api_should_not_trigger_basic_http_auth_with_non_basic_authorization_header | |
37 | ApplicationController.any_instance.expects(:authenticate_with_http_basic).never |
|
38 | ApplicationController.any_instance.expects(:authenticate_with_http_basic).never | |
38 | get '/users/current.xml', {}, 'HTTP_AUTHORIZATION' => 'Digest foo bar' |
|
39 | get '/users/current.xml', {}, 'HTTP_AUTHORIZATION' => 'Digest foo bar' | |
|
40 | assert_response 401 | |||
39 | end |
|
41 | end | |
40 |
|
42 | |||
41 | def test_invalid_utf8_credentials_should_not_trigger_an_error |
|
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