X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b816bad72615a3112ae39c26c0afcc699f16cb9d..86fae8980d97ba7fdd9345eb5e372fd4f8f20b7f:/test/controllers/api/permissions_controller_test.rb?ds=inline 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