]> source.dussan.org Git - redmine.git/commitdiff
Include private_notes property in xml/json Journals output (#20985).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 16 May 2016 06:25:11 +0000 (06:25 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 16 May 2016 06:25:11 +0000 (06:25 +0000)
Patch by Takenori TAKAKI.

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

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

index 072709e57c26fdad399f7008169dd3dffa521e76..f474ed9c6eb02d59651aa979442d1934576184ad 100644 (file)
@@ -59,6 +59,7 @@ api.issue do
         api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil?
         api.notes journal.notes
         api.created_on journal.created_on
+        api.private_notes journal.private_notes
         api.array :details do
           journal.visible_details.each do |detail|
             api.detail :property => detail.property, :name => detail.prop_key do
index 8b23dccc812744a67bf59acbef5121216a185611..b1e1891811add698be668d9a5615871668a2dfe3 100644 (file)
@@ -169,10 +169,13 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
   end
 
   test "GET /issues/:id.xml with journals" do
-    get '/issues/1.xml?include=journals'
+    Journal.find(2).update_attribute(:private_notes, true)
+
+    get '/issues/1.xml?include=journals', {}, credentials('jsmith')
 
     assert_select 'issue journals[type=array]' do
       assert_select 'journal[id="1"]' do
+        assert_select 'private_notes', :text => 'false'
         assert_select 'details[type=array]' do
           assert_select 'detail[name=status_id]' do
             assert_select 'old_value', :text => '1'
@@ -180,6 +183,10 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
           end
         end
       end
+      assert_select 'journal[id="2"]' do
+        assert_select 'private_notes', :text => 'true'
+        assert_select 'details[type=array]'
+      end
     end
   end