@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+module ShopifyAPI
+ class ApiPermission < Base
+ def self.destroy
+ delete(:current)
+ end
+end
@@ -1,8 +1,16 @@
+# This resource is deprecated and will be removed in a future version of this gem.
+# Use ShopifyAPI::ApiPermission.destroy instead
module ShopifyAPI
class OAuth < Base
self.collection_name = 'oauth'
def self.revoke
+ warn '[DEPRECATED] ShopifyAPI::OAuth#revoke is deprecated and will be removed in a future version. ' \
+ 'Use ShopifyAPI::ApiPermission#destroy instead.'
delete(:revoke)
end
+require 'test_helper'
+class ApiPermissionTest < Test::Unit::TestCase
+ test "revoke access token" do
+ fake "api_permissions/current", method: :delete, status: 200, body: "{}"
+ assert ShopifyAPI::ApiPermission.destroy