+
+ def test_user_api_read
+ # check that a visible user is returned properly
+ get :api_read, :id => users(:normal_user).id
+ assert_response :success
+
+ # check that we aren't revealing private information
+ assert_select "contributor-terms[pd]", false
+ assert_select "home", false
+ assert_select "languages", false
+
+ # check that a suspended user is not returned
+ get :api_read, :id => users(:suspended_user).id
+ assert_response :gone
+
+ # check that a deleted user is not returned
+ get :api_read, :id => users(:deleted_user).id
+ assert_response :gone
+
+ # check that a non-existent user is not returned
+ get :api_read, :id => 0
+ assert_response :not_found
+ end
+