shopify_api 4.6.0 → 4.7.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b372c851db7445d6687816c3d008810155b61504
|
4
|
+
data.tar.gz: 488e2b61967bed7464f0ebf24cec6554e0f961da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b6e947edf820c32391fc11e8c4f4c4b2acb4899db0a174fa25b456ec0e23a221b27c5442ad98a33b2361ecd0d2db87615af59051c9412b837c4264ed99e329c
|
7
|
+
data.tar.gz: '099a49bff83d8115709f24b5a48afd90f3bef9e7fe35448a4ab5341785b1fc9bb64dbce1f7c31b3e8fb5d7eaeb6cb26fea44ae129bcbea8309666535012e3f8d'
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== Version 4.7.0
|
2
|
+
|
3
|
+
* Removed the mandatory `application_id` parameter from `ShopifyAPI::ProductListing` and `ShopifyAPI::CollectionListing`
|
4
|
+
* Fixed a bug related to the non-standard primary key for `ShopifyAPI::ProductListing` and `ShopifyAPI::CollectionListing`
|
5
|
+
|
1
6
|
== Version 4.6.0
|
2
7
|
|
3
8
|
* Added `ShopifyAPI::Report`
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module ShopifyAPI
|
2
2
|
class CollectionListing < Base
|
3
|
-
|
3
|
+
self.primary_key = :collection_id
|
4
4
|
|
5
|
-
def product_ids
|
6
|
-
get(
|
5
|
+
def product_ids
|
6
|
+
get(:product_ids)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
data/lib/shopify_api/version.rb
CHANGED
@@ -3,23 +3,39 @@ require 'test_helper'
|
|
3
3
|
class CollectionListingTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def test_get_collection_listings
|
6
|
-
fake "
|
6
|
+
fake "collection_listings", method: :get, status: 201, body: load_fixture('collection_listings')
|
7
7
|
|
8
|
-
collection_listings = ShopifyAPI::CollectionListing.find(:all
|
8
|
+
collection_listings = ShopifyAPI::CollectionListing.find(:all)
|
9
9
|
|
10
10
|
assert_equal 1, collection_listings.count
|
11
11
|
assert_equal 1, collection_listings.first.collection_id
|
12
12
|
assert_equal 'Home page', collection_listings.first.title
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
fake "
|
17
|
-
fake "applications/999/collection_listings//1/product_ids", method: :get, status: 201, body: load_fixture('collection_listing_product_ids')
|
15
|
+
def test_get_collection_listing
|
16
|
+
fake "collection_listings/1", method: :get, status: 201, body: load_fixture('collection_listing')
|
18
17
|
|
19
|
-
collection_listing = ShopifyAPI::CollectionListing.find(1
|
18
|
+
collection_listing = ShopifyAPI::CollectionListing.find(1)
|
20
19
|
|
21
20
|
assert_equal 1, collection_listing.collection_id
|
22
21
|
assert_equal 'Home page', collection_listing.title
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_get_collection_listing_reload
|
25
|
+
fake "collection_listings/1", method: :get, status: 201, body: load_fixture('collection_listing')
|
26
|
+
|
27
|
+
collection_listing = ShopifyAPI::CollectionListing.new(collection_id: 1)
|
28
|
+
collection_listing.reload
|
29
|
+
|
30
|
+
assert_equal 1, collection_listing.collection_id
|
31
|
+
assert_equal 'Home page', collection_listing.title
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_get_collection_listing_product_ids
|
35
|
+
fake "collection_listings/1/product_ids", method: :get, status: 201, body: load_fixture('collection_listing_product_ids')
|
36
|
+
|
37
|
+
collection_listing = ShopifyAPI::CollectionListing.new(collection_id: 1)
|
38
|
+
|
23
39
|
assert_equal [1, 2], collection_listing.product_ids
|
24
40
|
end
|
25
41
|
end
|
@@ -3,9 +3,9 @@ require 'test_helper'
|
|
3
3
|
class ProductListingTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def test_get_product_listings
|
6
|
-
fake "
|
6
|
+
fake "product_listings", method: :get, status: 201, body: load_fixture('product_listings')
|
7
7
|
|
8
|
-
product_listings = ShopifyAPI::ProductListing.find(:all
|
8
|
+
product_listings = ShopifyAPI::ProductListing.find(:all)
|
9
9
|
assert_equal 2, product_listings.count
|
10
10
|
assert_equal 2, product_listings.first.product_id
|
11
11
|
assert_equal 1, product_listings.last.product_id
|
@@ -13,17 +13,26 @@ class ProductListingTest < Test::Unit::TestCase
|
|
13
13
|
assert_equal 'Rustic Copper Bottle', product_listings.last.title
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
fake "
|
16
|
+
def test_get_product_listing
|
17
|
+
fake "product_listings/2", method: :get, status: 201, body: load_fixture('product_listing')
|
18
|
+
|
19
|
+
product_listing = ShopifyAPI::ProductListing.find(2)
|
20
|
+
assert_equal 'Synergistic Silk Chair', product_listing.title
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_reload_product_listing
|
24
|
+
fake "product_listings/2", method: :get, status: 201, body: load_fixture('product_listing')
|
25
|
+
|
26
|
+
product_listing = ShopifyAPI::ProductListing.new(product_id: 2)
|
27
|
+
product_listing.reload
|
18
28
|
|
19
|
-
product_listing = ShopifyAPI::ProductListing.find(2, params: { application_id: 999 })
|
20
29
|
assert_equal 'Synergistic Silk Chair', product_listing.title
|
21
30
|
end
|
22
31
|
|
23
32
|
def test_get_product_listing_product_ids
|
24
|
-
fake "
|
33
|
+
fake "product_listings/product_ids", method: :get, status: 201, body: load_fixture('product_listing_product_ids')
|
25
34
|
|
26
|
-
product_ids = ShopifyAPI::ProductListing.product_ids
|
35
|
+
product_ids = ShopifyAPI::ProductListing.product_ids
|
27
36
|
assert_equal 2, product_ids.count
|
28
37
|
assert_equal 2, product_ids.first
|
29
38
|
assert_equal 1, product_ids.last
|
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.
|
4
|
+
version: 4.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|