diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2022-01-30 13:39:55 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2022-01-30 13:39:55 +0000 |
commit | 5ea0340b8d93062e3687c896ed8f79d72b3c2f2b (patch) | |
tree | 12bc36a8d4820fc0c822b117a25d44656cc1492c /test | |
parent | 9f6d8711e767a5a4b57cb05f3ad175e3d675d05b (diff) | |
download | redmine-5ea0340b8d93062e3687c896ed8f79d72b3c2f2b.tar.gz redmine-5ea0340b8d93062e3687c896ed8f79d72b3c2f2b.zip |
Add test for #34766.
Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@21393 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/api_test/api_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/integration/api_test/api_test.rb b/test/integration/api_test/api_test.rb index 1b1359f2e..b16a50471 100644 --- a/test/integration/api_test/api_test.rb +++ b/test/integration/api_test/api_test.rb @@ -57,4 +57,11 @@ class Redmine::ApiTest::ApiTest < Redmine::ApiTest::Base assert_response :no_content assert_equal '', response.body end + + def test_api_with_invalid_format_should_return_406 + get '/users/1', :headers => credentials('admin').merge({'Accept' => 'application/xml', 'Content-type' => 'application/xml'}) + + assert_response :not_acceptable + assert_equal "We couldn't handle your request, sorry. If you were trying to access the API, make sure to append .json or .xml to your request URL.\n", response.body + end end |