]> source.dussan.org Git - redmine.git/commitdiff
Changes the representation of journal details in issue API.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 10 Dec 2010 12:22:37 +0000 (12:22 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 10 Dec 2010 12:22:37 +0000 (12:22 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4483 e93f8b46-1217-0410-a6f0-8f06a7374b81

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

index 02e7fdd297015ecfb6a34f4c903375c0d2a97a7b..9f0d59e8df053f5e19724122a30ea145059463ee 100644 (file)
@@ -50,7 +50,10 @@ api.issue do
                        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
index a5281e5ebdf8bd5d765ebe76f8917a16895cfb29..3988ee5b7106b06d6c1f0bbbbb2d7b37cc297789 100644 (file)
@@ -91,6 +91,40 @@ class ApiTest::IssuesTest < ActionController::IntegrationTest
   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