Adds project status to GET /projects/:id and GET /projects API response (#15815).
git-svn-id: http://svn.redmine.org/redmine/trunk@12649 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
a89468ebc8
commit
de19424ea5
@ -6,6 +6,7 @@ api.array :projects, api_meta(:total_count => @project_count, :offset => @offset
|
|||||||
api.identifier project.identifier
|
api.identifier project.identifier
|
||||||
api.description project.description
|
api.description project.description
|
||||||
api.parent(:id => project.parent.id, :name => project.parent.name) if project.parent && project.parent.visible?
|
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
|
render_api_custom_values project.visible_custom_field_values, api
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ api.project do
|
|||||||
api.description @project.description
|
api.description @project.description
|
||||||
api.homepage @project.homepage
|
api.homepage @project.homepage
|
||||||
api.parent(:id => @project.parent.id, :name => @project.parent.name) if @project.parent && @project.parent.visible?
|
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
|
render_api_custom_values @project.visible_custom_field_values, api
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal 'application/xml', @response.content_type
|
assert_equal 'application/xml', @response.content_type
|
||||||
|
|
||||||
assert_tag :tag => 'projects',
|
assert_select 'projects>project>id', :text => '1'
|
||||||
:child => {:tag => 'project', :child => {:tag => 'id', :content => '1'}}
|
assert_select 'projects>project>status', :text => '1'
|
||||||
end
|
end
|
||||||
|
|
||||||
test "GET /projects.json should return projects" do
|
test "GET /projects.json should return projects" do
|
||||||
@ -70,10 +70,9 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal 'application/xml', @response.content_type
|
assert_equal 'application/xml', @response.content_type
|
||||||
|
|
||||||
assert_tag :tag => 'project',
|
assert_select 'project>id', :text => '1'
|
||||||
:child => {:tag => 'id', :content => '1'}
|
assert_select 'project>status', :text => '1'
|
||||||
assert_tag :tag => 'custom_field',
|
assert_select 'custom_field[name=Development status]', :text => 'Stable'
|
||||||
:attributes => {:name => 'Development status'}, :content => 'Stable'
|
|
||||||
|
|
||||||
assert_no_tag 'trackers'
|
assert_no_tag 'trackers'
|
||||||
assert_no_tag 'issue_categories'
|
assert_no_tag 'issue_categories'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user