From: Jean-Baptiste Barth Date: Fri, 15 Aug 2014 09:57:00 +0000 (+0000) Subject: Add project is_public to GET /projects/:id and /projects API response (#17628). X-Git-Tag: 2.6.0~79 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=772418461f0cba3d8d58065e635e8bc949bdf59d;p=redmine.git Add project is_public to GET /projects/:id and /projects API response (#17628). Contributed by Michael Esemplare git-svn-id: http://svn.redmine.org/redmine/trunk@13339 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/projects/index.api.rsb b/app/views/projects/index.api.rsb index 1aa5fe796..a07db1b71 100644 --- a/app/views/projects/index.api.rsb +++ b/app/views/projects/index.api.rsb @@ -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 diff --git a/app/views/projects/show.api.rsb b/app/views/projects/show.api.rsb index e84ebb073..7a1e07c02 100644 --- a/app/views/projects/show.api.rsb +++ b/app/views/projects/show.api.rsb @@ -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 diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb index 9f63e3328..efb41f03b 100644 --- a/test/integration/api_test/projects_test.rb +++ b/test/integration/api_test/projects_test.rb @@ -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'