]> git.openstreetmap.org Git - rails.git/blobdiff - test/test_helper.rb
Simplify write_notes scope check in api notes controller
[rails.git] / test / test_helper.rb
index 79d5d0d33664e53769d575684ae9dc86e7445c3c..90a33dbf60ed5895dd2a1ec5489ae3d85ac746fb 100644 (file)
@@ -138,7 +138,7 @@ module ActiveSupport
     def bearer_authorization_header(token_or_user = nil, scopes: Oauth::SCOPES)
       token = case token_or_user
               when nil then create(:oauth_access_token, :scopes => scopes).token
     def bearer_authorization_header(token_or_user = nil, scopes: Oauth::SCOPES)
       token = case token_or_user
               when nil then create(:oauth_access_token, :scopes => scopes).token
-              when User then create(:oauth_access_token, :resource_owner_id => token_or_user.id, :scopes => scopes).token
+              when User then create(:oauth_access_token, :user => token_or_user, :scopes => scopes).token
               when Doorkeeper::AccessToken then token_or_user.token
               when String then token_or_user
               end
               when Doorkeeper::AccessToken then token_or_user.token
               when String then token_or_user
               end