summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2013-05-05 08:19:17 +0000
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2013-05-05 08:19:17 +0000
commitec4dbbced5d98f4f8ac599b4b2bc6ba0b4dbfcd1 (patch)
tree4b8c38450631fbaf7f3b56101153cabe1d49b95f /test/integration
parentafa9100453a0cd4f7ba150f036f8eb7aada788af (diff)
downloadredmine-ec4dbbced5d98f4f8ac599b4b2bc6ba0b4dbfcd1.tar.gz
redmine-ec4dbbced5d98f4f8ac599b4b2bc6ba0b4dbfcd1.zip
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
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/api_test/users_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/integration/api_test/users_test.rb b/test/integration/api_test/users_test.rb
index 7f72872a2..f90e8cb3d 100644
--- a/test/integration/api_test/users_test.rb
+++ b/test/integration/api_test/users_test.rb
@@ -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