X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/dff8effc13d16e4b0fb4992863993cdddc23ec99..37a7996d949b47f76e5a38cc227f5bbb3e4c19fe:/test/controllers/api/users_controller_test.rb diff --git a/test/controllers/api/users_controller_test.rb b/test/controllers/api/users_controller_test.rb index 2824c40b2..5ce30d6a6 100644 --- a/test/controllers/api/users_controller_test.rb +++ b/test/controllers/api/users_controller_test.rb @@ -81,6 +81,15 @@ module Api # check that a non-existent user is not returned get api_user_path(:id => 0) assert_response :not_found + + # check that a visible user is returned properly in json + get api_user_path(:id => user.id, :format => "json") + assert_response :success + assert_equal "application/json", response.media_type + + js = ActiveSupport::JSON.decode(@response.body) + assert_not_nil js + assert_equal user.id, js["user"]["id"] end def test_details