]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/api/permissions_controller_test.rb
Merge pull request #4761 from AntonKhorev:dark-mode-with-close-button
[rails.git] / test / controllers / api / permissions_controller_test.rb
index 1ee3365e70bd931e6189d547189c5b813054cf48..2a7ac5e121d9113b309fdc890a247852e92515d6 100644 (file)
@@ -34,10 +34,8 @@ module Api
 
     def test_permissions_oauth2
       user = create(:user)
 
     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
       assert_response :success
       assert_select "osm > permissions", :count => 1 do
         assert_select "permission", :count => 2