- test "non-admin user can limit index" do
- authorize_with :spectator
- get(:index, limit: 2)
- check_non_admin_index
- assert_equal(2, json_response["items"].size,
- "non-admin index limit was ineffective")
- end
-
- test "filters are ignored for non-admin index" do
- check_index_condition_fails(:spectator,
- filters: [["last_name", "=", "__nonexistent__"]])
- end
-
- test "where is ignored for non-admin index" do
- check_index_condition_fails(:spectator,
- where: {last_name: "__nonexistent__"})
+ test "non-admin user gets only safe attributes from users#show" do
+ g = act_as_system_user do
+ create :group
+ end
+ users = create_list :active_user, 2, join_groups: [g]
+ token = create :token, user: users[0]
+ authorize_with_token token
+ get :show, id: users[1].uuid
+ check_non_admin_show