X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/973d62a25ebf22bf80663a8b6996f0dbe7d5289f..7b05c1c060f3f85f47413ec7db984180514d3ba6:/test/controllers/api/permissions_controller_test.rb diff --git a/test/controllers/api/permissions_controller_test.rb b/test/controllers/api/permissions_controller_test.rb index 1ee3365e7..2a7ac5e12 100644 --- a/test/controllers/api/permissions_controller_test.rb +++ b/test/controllers/api/permissions_controller_test.rb @@ -34,10 +34,8 @@ module Api def test_permissions_oauth2 user = create(:user) - token = create(:oauth_access_token, - :resource_owner_id => user.id, - :scopes => %w[read_prefs write_api]) - get permissions_path, :headers => bearer_authorization_header(token.token) + auth_header = bearer_authorization_header(user, :scopes => %w[read_prefs write_api]) + get permissions_path, :headers => auth_header assert_response :success assert_select "osm > permissions", :count => 1 do assert_select "permission", :count => 2