Skip to content

Commit

Permalink
Merge pull request #185 from Shopify/revoke_token
Browse files Browse the repository at this point in the history
Add support for token revocation
  • Loading branch information
nickhoffman committed May 4, 2015
2 parents 390cfbe + 9da9190 commit b147150
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/shopify_api/resources/o_auth.rb
@@ -0,0 +1,9 @@
module ShopifyAPI
class OAuth < Base
self.collection_name = 'oauth'

def self.revoke
delete(:revoke)
end
end
end
5 changes: 5 additions & 0 deletions test/fixtures/o_auth_revoke.json
@@ -0,0 +1,5 @@
{
"permission": {
"access_token": "8ccb0232e04c672bf044f71ff0156098"
}
}
8 changes: 8 additions & 0 deletions test/o_auth_test.rb
@@ -0,0 +1,8 @@
require 'test_helper'

class OAuthTest < Test::Unit::TestCase
def test_revoke_kills_the_token
fake 'oauth/revoke', method: :delete, body: load_fixture('o_auth_revoke')
assert ShopifyAPI::OAuth.revoke
end
end

0 comments on commit b147150

Please sign in to comment.