summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-23 19:45:23 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-07-23 19:45:23 +0000
commitfdd5367ebab20caf34013e06d266daef1ddb30e5 (patch)
tree22cbea562aaf92577080ccb7da8e6397f599cc3e /test/integration/api_test
parent2ce3191639dcbf3929ce2208a5edba96ba812a2c (diff)
downloadredmine-fdd5367ebab20caf34013e06d266daef1ddb30e5.tar.gz
redmine-fdd5367ebab20caf34013e06d266daef1ddb30e5.zip
Respond with errors and appropriate content type on /issues API calls with invalid query params (#8883).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6309 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r--test/integration/api_test/issues_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb
index 763cf34d5..3dbd229a2 100644
--- a/test/integration/api_test/issues_test.rb
+++ b/test/integration/api_test/issues_test.rb
@@ -101,6 +101,16 @@ class ApiTest::IssuesTest < ActionController::IntegrationTest
}
end
end
+
+ context "with invalid query params" do
+ should "return errors" do
+ get '/issues.xml', {:f => ['start_date'], :op => {:start_date => '='}}
+
+ assert_response :unprocessable_entity
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'errors', :child => {:tag => 'error', :content => "Start date can't be blank"}
+ end
+ end
end
context "/index.json" do