shopify_api 4.2.1 → 4.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3dde0dd1ec00e7646f6b4f75e6a6246798524e18
4
- data.tar.gz: 10564e66476aa650ad5966f1be14e420ab3fec51
3
+ metadata.gz: 0fdce8306a9014e8357e21815c44369596dd94f1
4
+ data.tar.gz: a5554efc1f1c6b34a7129fc4db40c923c400bee9
5
5
  SHA512:
6
- metadata.gz: ee2a33489d65026ea0cd8e14a0f25e16aad685465a7ec8e933c92e0269e31d43bd0c244f2f71fd86666699637563c7ab95b7cd0ad3215b19b2e3f418d2e4aa08
7
- data.tar.gz: 4782ff90ba01c1a4949460a9aa02743903e1a1d66d9b644a3ab103eebefa01331be2a611e0ba655aafc8236becd4552cea42d6cc7b4a78c3794ce69cb95f2f56
6
+ metadata.gz: 47c47ae9baa73dfea72a4dc9fc1bb185dedbd53c346070a6a5b9ec65e4fba0938f5ebd668a2d9bcea0dd92bd976ed6a627d34076267dfac2795ec62ad41e644e
7
+ data.tar.gz: 356e392df148854efde592234cd09e9505ea4b954c54cf1a978c4797b01768abd1be4c26bb14b72c62765b8514f393ed1b574b97cf874e14c7881bf650e06912
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == Version 4.2.2
2
+
3
+ * Support for AccessToken#delegate endpoint
4
+
1
5
  == Version 4.2.1
2
6
 
3
7
  * Support for Users and Discounts (Shopify Plus only)
@@ -0,0 +1,8 @@
1
+ module ShopifyAPI
2
+ class AccessToken < Base
3
+ def self.delegate(access_scope, expires_in = nil)
4
+ resource = post(:delegate, delegate_access_scope: access_scope, expires_in: expires_in)
5
+ instantiate_record(format.decode(resource.body), {})
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module ShopifyAPI
2
- VERSION = "4.2.1"
2
+ VERSION = "4.2.2"
3
3
  end
@@ -0,0 +1,19 @@
1
+ require 'test_helper'
2
+
3
+ class AccessTokenTest < Test::Unit::TestCase
4
+
5
+ def test_delegate_access_token
6
+ fake "access_tokens/delegate.json?delegate_access_scope%5B%5D=write_orders&" \
7
+ "delegate_access_scope%5B%5D=read_products&expires_in=",
8
+ method: :post,
9
+ status: 201,
10
+ body: load_fixture('access_token_delegate'),
11
+ extension: false
12
+
13
+ delegate_scope = ['write_orders', 'read_products']
14
+ token = ShopifyAPI::AccessToken.delegate(delegate_scope)
15
+
16
+ assert_equal 'abracadabra', token.access_token
17
+ assert_equal 'write_orders,read_products', token.scope
18
+ end
19
+ end
@@ -0,0 +1,4 @@
1
+ {
2
+ "access_token": "abracadabra",
3
+ "scope": "write_orders,read_products"
4
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-27 00:00:00.000000000 Z
11
+ date: 2016-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource
@@ -137,6 +137,7 @@ files:
137
137
  - lib/shopify_api/limits.rb
138
138
  - lib/shopify_api/metafields.rb
139
139
  - lib/shopify_api/resources.rb
140
+ - lib/shopify_api/resources/access_token.rb
140
141
  - lib/shopify_api/resources/address.rb
141
142
  - lib/shopify_api/resources/announcement.rb
142
143
  - lib/shopify_api/resources/application_charge.rb
@@ -198,6 +199,7 @@ files:
198
199
  - lib/shopify_api/version.rb
199
200
  - shipit.rubygems.yml
200
201
  - shopify_api.gemspec
202
+ - test/access_token_test.rb
201
203
  - test/active_resource/json_errors_test.rb
202
204
  - test/application_charge_test.rb
203
205
  - test/article_test.rb
@@ -213,6 +215,7 @@ files:
213
215
  - test/customer_test.rb
214
216
  - test/detailed_log_subscriber_test.rb
215
217
  - test/discount_test.rb
218
+ - test/fixtures/access_token_delegate.json
216
219
  - test/fixtures/application_charge.json
217
220
  - test/fixtures/application_charges.json
218
221
  - test/fixtures/article.json