shopify_api 4.3.8 → 4.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shopify_api/resources/resource_feedback.rb +1 -0
- data/lib/shopify_api/version.rb +1 -1
- data/test/resource_feedback_test.rb +19 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c3a9cf187de2632f21aae6abccf97761a15646a
|
4
|
+
data.tar.gz: 50df871acee66ab97b06afdae4a5d1e2de9c46f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caa0e73d8fe90dfdaea35ce6098b13df2c42fb2127e97969ac52a8e71359b0453bcfdd5a7f2cfda1c98c32eff5856db58a23dc24cb35d4b04f95ab10b6dab3ad
|
7
|
+
data.tar.gz: 2866caca89f807ffba6299fc534e6fc171e399c6c66a6bbdd1e45361c611b9fa36c7ac08de4afd9ac4c8b21bcbe95897663f90445aa60f8ef89cf7142eaf596b
|
@@ -5,6 +5,7 @@ module ShopifyAPI
|
|
5
5
|
class ExistingFeedbackSaved < StandardError; end
|
6
6
|
include DisablePrefixCheck
|
7
7
|
|
8
|
+
self.collection_name = 'resource_feedback'
|
8
9
|
conditional_prefix :product, false
|
9
10
|
|
10
11
|
EXISTING_FEEDBACK_SAVED_ERROR_MESSAGE = 'WARNING: Attempted call to ShopifyAPI::ResourceFeedback#save' \
|
data/lib/shopify_api/version.rb
CHANGED
@@ -1,21 +1,35 @@
|
|
1
1
|
class ResourceFeedbackTest < Test::Unit::TestCase
|
2
|
-
def
|
2
|
+
def test_get_resource_feedback
|
3
|
+
body = { resource_feedback: [ { resource_type: 'Shop' } ] }.to_json
|
4
|
+
fake 'resource_feedback', method: :get, body: body
|
5
|
+
resource_feedback = ShopifyAPI::ResourceFeedback.find(:all)
|
6
|
+
assert_equal 'Shop', resource_feedback.first.resource_type
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_save_with_resource_feedback_endpoint
|
3
10
|
body = { resource_feedback: {} }.to_json
|
4
|
-
fake '
|
11
|
+
fake 'resource_feedback', method: :post, body: body
|
5
12
|
ShopifyAPI::ResourceFeedback.new.save
|
6
13
|
assert_request_body body
|
7
14
|
end
|
8
15
|
|
9
|
-
def
|
16
|
+
def test_get_resource_feedback_with_product_id
|
17
|
+
body = { resource_feedback: [ { resource_type: 'Product' } ] }.to_json
|
18
|
+
fake 'products/42/resource_feedback', method: :get, body: body
|
19
|
+
resource_feedback = ShopifyAPI::ResourceFeedback.find(:all, params: { product_id: 42 })
|
20
|
+
assert_equal 'Product', resource_feedback.first.resource_type
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_save_with_product_id_resource_feedback_endpoint
|
10
24
|
body = { resource_feedback: {} }.to_json
|
11
|
-
fake 'products/42/
|
25
|
+
fake 'products/42/resource_feedback', method: :post, body: body
|
12
26
|
ShopifyAPI::ResourceFeedback.new(product_id: 42).save
|
13
27
|
assert_request_body body
|
14
28
|
end
|
15
29
|
|
16
30
|
def test_save_raises_exception_when_already_persisted
|
17
31
|
body = { resource_feedback: {} }.to_json
|
18
|
-
fake '
|
32
|
+
fake 'resource_feedback', method: :post, body: body
|
19
33
|
resource_feedback = ShopifyAPI::ResourceFeedback.new
|
20
34
|
resource_feedback.save
|
21
35
|
assert_request_body body
|
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.3.
|
4
|
+
version: 4.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|