]> source.dussan.org Git - redmine.git/commitdiff
Add project is_public to GET /projects/:id and /projects API response (#17628).
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Fri, 15 Aug 2014 09:57:00 +0000 (09:57 +0000)
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>
Fri, 15 Aug 2014 09:57:00 +0000 (09:57 +0000)
Contributed by Michael Esemplare <michael.esemplare@gmail.com>

git-svn-id: http://svn.redmine.org/redmine/trunk@13339 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 1aa5fe796d1a263f929776647d5782d661a4e707..a07db1b710b05f263eafdf7bec2af56e467e45c8 100644 (file)
@@ -7,6 +7,7 @@ api.array :projects, api_meta(:total_count => @project_count, :offset => @offset
       api.description project.description
       api.parent(:id => project.parent.id, :name => project.parent.name) if project.parent && project.parent.visible?
       api.status      project.status
+      api.is_public   project.is_public?
 
       render_api_custom_values project.visible_custom_field_values, api
 
index e84ebb073fe1f329f4e3062feb1253e1317d87e7..7a1e07c02ccb349239375f016e29d7f279e3dbc2 100644 (file)
@@ -6,6 +6,7 @@ api.project do
   api.homepage    @project.homepage
   api.parent(:id => @project.parent.id, :name => @project.parent.name) if @project.parent && @project.parent.visible?
   api.status      @project.status
+  api.is_public   @project.is_public?
 
   render_api_custom_values @project.visible_custom_field_values, api
 
index 9f63e3328c71381d6982373bbcd145e616bdcd80..efb41f03bf8c47b3e36b6d1f1f792f7f13efb082 100644 (file)
@@ -51,6 +51,7 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
 
     assert_select 'projects>project>id', :text => '1'
     assert_select 'projects>project>status', :text => '1'
+    assert_select 'projects>project>is_public', :text => 'true'
   end
 
   test "GET /projects.json should return projects" do
@@ -72,6 +73,7 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
 
     assert_select 'project>id', :text => '1'
     assert_select 'project>status', :text => '1'
+    assert_select 'project>is_public', :text => 'true'
     assert_select 'custom_field[name=Development status]', :text => 'Stable'
 
     assert_no_tag 'trackers'