Add attachment information to issues.xml in REST API (#12181).

git-svn-id: http://svn.redmine.org/redmine/trunk@16360 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2017-03-03 17:18:58 +00:00
parent 3faa3693d1
commit 331c1f674d
2 changed files with 22 additions and 0 deletions

View File

@@ -82,6 +82,22 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
end
end
test "GET /issues.xml with attachments" do
get '/issues.xml?include=attachments'
assert_response :success
assert_equal 'application/xml', @response.content_type
assert_select 'issue id', :text => '3' do
assert_select '~ attachments attachment', 4
end
assert_select 'issue id', :text => '1' do
assert_select '~ attachments'
assert_select '~ attachments attachment', 0
end
end
test "GET /issues.xml with invalid query params" do
get '/issues.xml', {:f => ['start_date'], :op => {:start_date => '='}}