mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 19:36:00 +01:00
Add status to /users/:id API for admins (#13948).
Patch by Kambiz Darabi git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11790 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -120,6 +120,18 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
|
||||
assert_tag 'user', :child => {:tag => 'api_key', :content => User.find(2).api_key}
|
||||
end
|
||||
|
||||
test "GET /users/:id should not return status for standard user" do
|
||||
get '/users/3.xml', {}, credentials('jsmith')
|
||||
assert_response :success
|
||||
assert_no_tag 'user', :child => {:tag => 'status'}
|
||||
end
|
||||
|
||||
test "GET /users/:id should return status for administrators" do
|
||||
get '/users/2.xml', {}, credentials('admin')
|
||||
assert_response :success
|
||||
assert_tag 'user', :child => {:tag => 'status', :content => User.find(1).status.to_s}
|
||||
end
|
||||
|
||||
context "POST /users" do
|
||||
context "with valid parameters" do
|
||||
setup do
|
||||
|
||||
Reference in New Issue
Block a user