Project

General

Profile

Feature #20985 » adds_issue_journal_private_notes_to_api_trunk_r15327.patch

Takenori TAKAKI, 2016-04-12 05:01

View differences:

app/views/issues/show.api.rsb
59 59
        api.user(:id => journal.user_id, :name => journal.user.name) unless journal.user.nil?
60 60
        api.notes journal.notes
61 61
        api.created_on journal.created_on
62
        api.private_notes journal.private_notes
62 63
        api.array :details do
63 64
          journal.visible_details.each do |detail|
64 65
            api.detail :property => detail.property, :name => detail.prop_key do
test/integration/api_test/issues_test.rb
169 169
  end
170 170

  
171 171
  test "GET /issues/:id.xml with journals" do
172
    get '/issues/1.xml?include=journals'
172
    Journal.find(2).update_attribute(:private_notes, true)
173

  
174
    get '/issues/1.xml?include=journals', {}, credentials('jsmith')
173 175

  
174 176
    assert_select 'issue journals[type=array]' do
175 177
      assert_select 'journal[id="1"]' do
178
        assert_select 'private_notes', :text => 'false'
176 179
        assert_select 'details[type=array]' do
177 180
          assert_select 'detail[name=status_id]' do
178 181
            assert_select 'old_value', :text => '1'
......
180 183
          end
181 184
        end
182 185
      end
186
      assert_select 'journal[id="2"]' do
187
        assert_select 'private_notes', :text => 'true'
188
        assert_select 'details[type=array]'
189
      end
183 190
    end
184 191
  end
185 192

  
(2-2/2)