api.created_on @user.created_on
api.last_login_on @user.last_login_on
api.api_key @user.api_key if User.current.admin? || (User.current == @user)
+ api.status @user.status if User.current.admin?
render_api_custom_values @user.visible_custom_field_values, api
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