From 0d29d3208d865e969af8cb268178f3d186d77551 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 20 Sep 2018 14:54:38 +0000 Subject: Expose the Admin flag on the users api to admin users (#29459). Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@17496 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/api_test/users_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/integration/api_test/users_test.rb b/test/integration/api_test/users_test.rb index 192557808..80f237b25 100644 --- a/test/integration/api_test/users_test.rb +++ b/test/integration/api_test/users_test.rb @@ -125,6 +125,18 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base assert_select 'user status', :text => User.find(1).status.to_s end + test "GET /users/:id should return admin status for current user" do + get '/users/2.xml', :headers => credentials('jsmith') + assert_response :success + assert_select 'user admin', :text => 'false' + end + + test "GET /users/:id should not return admin status for other user" do + get '/users/3.xml', :headers => credentials('jsmith') + assert_response :success + assert_select 'user admin', 0 + end + test "POST /users.xml with valid parameters should create the user" do assert_difference('User.count') do post '/users.xml', -- cgit v1.2.3