Commit 3702e2ea authored by jplang's avatar jplang

Makes users optional in GET /groups/:id (#8981).

git-svn-id: https://svn.redmine.org/redmine/trunk@9765 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 5794039b
......@@ -8,7 +8,7 @@ api.group do
@group.users.each do |user|
api.user :id => user.id, :name => user.name
end
end
end if include_in_api_response?('users')
api.array :memberships do
@group.memberships.each do |membership|
......
......@@ -76,6 +76,15 @@ class ApiTest::GroupsTest < ActionController::IntegrationTest
assert_select 'group' do
assert_select 'name', :text => 'A Team'
assert_select 'id', :text => '10'
end
end
should "include users if requested" do
get '/groups/10.xml?include=users', {}, credentials('admin')
assert_response :success
assert_equal 'application/xml', response.content_type
assert_select 'group' do
assert_select 'users' do
assert_select 'user', Group.find(10).users.count
assert_select 'user[id=8]'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment