diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-07-24 15:34:41 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-07-24 15:34:41 +0000 |
commit | 521eaa79cb56a86e83876d95fa510ca13aebfbdf (patch) | |
tree | 94e033dcd604795d60616520597a678b1fa96635 /test/integration/api_test | |
parent | 49900051ea2b404161dae568eeaec6f26bbe0c9d (diff) | |
download | redmine-521eaa79cb56a86e83876d95fa510ca13aebfbdf.tar.gz redmine-521eaa79cb56a86e83876d95fa510ca13aebfbdf.zip |
Ability to load relations on /issues API (#7366).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6313 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r-- | test/integration/api_test/issues_test.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb index 3dbd229a2..117dde1b1 100644 --- a/test/integration/api_test/issues_test.rb +++ b/test/integration/api_test/issues_test.rb @@ -47,7 +47,7 @@ class ApiTest::IssuesTest < ActionController::IntegrationTest Setting.rest_api_enabled = '1' end - context "/index.xml" do + context "/issues" do # Use a private project to make sure auth is really working and not just # only showing public issues. should_allow_api_authentication(:get, "/projects/private-child/issues.xml") @@ -102,6 +102,25 @@ class ApiTest::IssuesTest < ActionController::IntegrationTest end end + context "with relations" do + should "display relations" do + get '/issues.xml?include=relations' + + assert_response :success + assert_equal 'application/xml', @response.content_type + assert_tag 'relations', + :parent => {:tag => 'issue', :child => {:tag => 'id', :content => '3'}}, + :children => {:count => 1}, + :child => { + :tag => 'relation', + :attributes => {:id => '2', :issue_id => '2', :issue_to_id => '3', :relation_type => 'relates'} + } + assert_tag 'relations', + :parent => {:tag => 'issue', :child => {:tag => 'id', :content => '1'}}, + :children => {:count => 0} + end + end + context "with invalid query params" do should "return errors" do get '/issues.xml', {:f => ['start_date'], :op => {:start_date => '='}} |