api.notes journal.notes
api.array :details do
journal.details.each do |detail|
- api.detail :property => detail.property, :name => detail.prop_key, :old => detail.old_value, :new => detail.value
+ api.detail :property => detail.property, :name => detail.prop_key do
+ api.old_value detail.old_value
+ api.new_value detail.value
+ end
end
end
end
end
context "GET /issues/:id" do
+ context "with journals" do
+ context ".xml" do
+ should "display journals" do
+ get '/issues/1.xml'
+
+ assert_tag :tag => 'issue',
+ :child => {
+ :tag => 'journals',
+ :attributes => { :type => 'array' },
+ :child => {
+ :tag => 'journal',
+ :attributes => { :id => '1'},
+ :child => {
+ :tag => 'details',
+ :attributes => { :type => 'array' },
+ :child => {
+ :tag => 'detail',
+ :attributes => { :name => 'status_id' },
+ :child => {
+ :tag => 'old_value',
+ :content => '1',
+ :sibling => {
+ :tag => 'new_value',
+ :content => '2'
+ }
+ }
+ }
+ }
+ }
+ }
+ end
+ end
+ end
+
context "with custom fields" do
context ".xml" do
should "display custom fields" do