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
This commit is contained in:
Jean-Philippe Lang
2011-07-23 19:45:23 +00:00
parent 2ce3191639
commit fdd5367eba
2 changed files with 14 additions and 2 deletions
+10
View File
@@ -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