]> source.dussan.org Git - redmine.git/commitdiff
Adds project status to GET /projects/:id and GET /projects API response (#15815).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 11 Jan 2014 11:33:47 +0000 (11:33 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 11 Jan 2014 11:33:47 +0000 (11:33 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12649 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/projects/index.api.rsb
app/views/projects/show.api.rsb
test/integration/api_test/projects_test.rb

index 8fdea9bae71d680681bce1803a526e37acf9f696..1aa5fe796d1a263f929776647d5782d661a4e707 100644 (file)
@@ -6,6 +6,7 @@ api.array :projects, api_meta(:total_count => @project_count, :offset => @offset
       api.identifier  project.identifier
       api.description project.description
       api.parent(:id => project.parent.id, :name => project.parent.name) if project.parent && project.parent.visible?
+      api.status      project.status
 
       render_api_custom_values project.visible_custom_field_values, api
 
index a6f26f893b408f52ee82bd972f27aef63f023590..e84ebb073fe1f329f4e3062feb1253e1317d87e7 100644 (file)
@@ -5,6 +5,7 @@ api.project do
   api.description @project.description
   api.homepage    @project.homepage
   api.parent(:id => @project.parent.id, :name => @project.parent.name) if @project.parent && @project.parent.visible?
+  api.status      @project.status
 
   render_api_custom_values @project.visible_custom_field_values, api
 
index 723e783b15558b1e662c867ac45c4f0588b52779..441cd48449fc480ac0f2114f824a50a41df364f0 100644 (file)
@@ -49,8 +49,8 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
     assert_response :success
     assert_equal 'application/xml', @response.content_type
 
-    assert_tag :tag => 'projects',
-      :child => {:tag => 'project', :child => {:tag => 'id', :content => '1'}}
+    assert_select 'projects>project>id', :text => '1'
+    assert_select 'projects>project>status', :text => '1'
   end
 
   test "GET /projects.json should return projects" do
@@ -70,10 +70,9 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
     assert_response :success
     assert_equal 'application/xml', @response.content_type
 
-    assert_tag :tag => 'project',
-      :child => {:tag => 'id', :content => '1'}
-    assert_tag :tag => 'custom_field',
-      :attributes => {:name => 'Development status'}, :content => 'Stable'
+    assert_select 'project>id', :text => '1'
+    assert_select 'project>status', :text => '1'
+    assert_select 'custom_field[name=Development status]', :text => 'Stable'
 
     assert_no_tag 'trackers'
     assert_no_tag 'issue_categories'