]> source.dussan.org Git - redmine.git/commitdiff
Adds sharing attribute to the versions API (#11541).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 31 Jul 2012 18:14:28 +0000 (18:14 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 31 Jul 2012 18:14:28 +0000 (18:14 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10148 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/versions/index.api.rsb
app/views/versions/show.api.rsb
test/integration/api_test/versions_test.rb

index 3a262550b639dda4de39bbdd83cf76b62ec74b69..3adde2b988b712d8682f73213a88781399b2eb79 100644 (file)
@@ -8,6 +8,7 @@ api.array :versions, api_meta(:total_count => @versions.size) do
       api.description version.description
       api.status      version.status
       api.due_date    version.effective_date
+      api.sharing     version.sharing
 
       render_api_custom_values version.custom_field_values, api
 
index 08ba00cf34c60cbc393191c8036d32b3769bb64f..63bf2d37980a4164a037f9fc75373ceda5353b40 100644 (file)
@@ -6,6 +6,7 @@ api.version do
   api.description @version.description
   api.status      @version.status
   api.due_date    @version.effective_date
+  api.sharing     @version.sharing
 
   render_api_custom_values @version.custom_field_values, api
 
index 90b0fb17a67a2ffd95d25914bf5bd2a796de961c..30ef19d7b9066ddabbbdb993497929ef5633e3a9 100644 (file)
@@ -103,15 +103,11 @@ class ApiTest::VersionsTest < ActionController::IntegrationTest
 
         assert_response :success
         assert_equal 'application/xml', @response.content_type
-        assert_tag 'version',
-          :child => {
-            :tag => 'id',
-            :content => '2',
-            :sibling => {
-              :tag => 'name',
-              :content => '1.0'
-            }
-          }
+        assert_select 'version' do
+          assert_select 'id', :text => '2'
+          assert_select 'name', :text => '1.0'
+          assert_select 'sharing', :text => 'none'
+        end
       end
     end