diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-20 14:55:44 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-20 14:55:44 +0000 |
commit | 30556f8cbfac04d5d6c6e3a9331874b7e83954d6 (patch) | |
tree | 5e5947d2058d374a6d59b5f225e8ef895a124039 /test/integration/api_test/projects_test.rb | |
parent | 95c172dab3a80a8c4c446979cf82b9a49fd8dabc (diff) | |
download | redmine-30556f8cbfac04d5d6c6e3a9331874b7e83954d6.tar.gz redmine-30556f8cbfac04d5d6c6e3a9331874b7e83954d6.zip |
Makes issue categories available in project REST API (#9553).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7880 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test/projects_test.rb')
-rw-r--r-- | test/integration/api_test/projects_test.rb | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb index 6b7d8d659..729333bed 100644 --- a/test/integration/api_test/projects_test.rb +++ b/test/integration/api_test/projects_test.rb @@ -20,7 +20,7 @@ require File.expand_path('../../../test_helper', __FILE__) class ApiTest::ProjectsTest < ActionController::IntegrationTest fixtures :projects, :versions, :users, :roles, :members, :member_roles, :issues, :journals, :journal_details, :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages, - :attachments, :custom_fields, :custom_values, :time_entries + :attachments, :custom_fields, :custom_values, :time_entries, :issue_categories def setup Setting.rest_api_enabled = '1' @@ -69,6 +69,9 @@ class ApiTest::ProjectsTest < ActionController::IntegrationTest :child => {:tag => 'id', :content => '1'} assert_tag :tag => 'custom_field', :attributes => {:name => 'Development status'}, :content => 'Stable' + + assert_no_tag 'trackers' + assert_no_tag 'issue_categories' end context "with hidden custom fields" do @@ -85,6 +88,38 @@ class ApiTest::ProjectsTest < ActionController::IntegrationTest :attributes => {:name => 'Development status'} end end + + should "return categories with include=issue_categories" do + get '/projects/1.xml?include=issue_categories' + assert_response :success + assert_equal 'application/xml', @response.content_type + + assert_tag 'issue_categories', + :attributes => {:type => 'array'}, + :child => { + :tag => 'issue_category', + :attributes => { + :id => '2', + :name => 'Recipes' + } + } + end + + should "return trackers with include=trackers" do + get '/projects/1.xml?include=trackers' + assert_response :success + assert_equal 'application/xml', @response.content_type + + assert_tag 'trackers', + :attributes => {:type => 'array'}, + :child => { + :tag => 'tracker', + :attributes => { + :id => '2', + :name => 'Feature request' + } + } + end end context ".json" do |