]> source.dussan.org Git - redmine.git/commitdiff
Issue API: include is_private attribute in xml/json output (#10914).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 Sep 2014 11:22:49 +0000 (11:22 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 Sep 2014 11:22:49 +0000 (11:22 +0000)
Patch by Shivam Daryanani.

git-svn-id: http://svn.redmine.org/redmine/trunk@13395 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/issues/index.api.rsb
app/views/issues/show.api.rsb
test/integration/api_test/issues_test.rb

index c3bcfd74b03a52fdd38e3d4422bd7b05a718e800..7660ccbd58bbc5f95a1198864a0655e579e39436 100644 (file)
@@ -17,6 +17,7 @@ api.array :issues, api_meta(:total_count => @issue_count, :offset => @offset, :l
       api.start_date  issue.start_date
       api.due_date    issue.due_date
       api.done_ratio  issue.done_ratio
+      api.is_private  issue.is_private
       api.estimated_hours issue.estimated_hours
 
       render_api_custom_values issue.visible_custom_field_values, api
index 3878e71bdebbad53e10118a7f1ee429dc1a8120e..f057b4c637446bae9fbc71d54d03bc4fd68ca134 100644 (file)
@@ -15,6 +15,7 @@ api.issue do
   api.start_date @issue.start_date
   api.due_date @issue.due_date
   api.done_ratio @issue.done_ratio
+  api.is_private @issue.is_private
   api.estimated_hours @issue.estimated_hours
   api.spent_hours(@issue.spent_hours) if User.current.allowed_to?(:view_time_entries, @project)
 
index d75f17252f03d5cbd08f11ff4c345a2f28d3a073..f6e458e99b13efbbfd19e5ae87659449f96e215e 100644 (file)
@@ -162,6 +162,11 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
     end
   end
 
+  def test_index_should_include_issue_attributes
+    get '/issues.xml'
+    assert_select 'issues>issue>is_private', :text => 'false'
+  end
+
   def test_index_should_allow_timestamp_filtering
     Issue.delete_all
     Issue.generate!(:subject => '1').update_column(:updated_on, Time.parse("2014-01-02T10:25:00Z"))
@@ -476,6 +481,11 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
     end
   end
 
+  def test_show_should_include_issue_attributes
+    get '/issues/1.xml'
+    assert_select 'issue>is_private', :text => 'false'
+  end
+
   test "GET /issues/:id.xml?include=watchers should include watchers" do
     Watcher.create!(:user_id => 3, :watchable => Issue.find(1))