shopify_api 4.3.8 → 4.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35549cc8cbf97caf5ad176ba2f743e181ed74419
4
- data.tar.gz: 6a90d8fc251927890d1d8340eb9bff7e1140a86d
3
+ metadata.gz: 9c3a9cf187de2632f21aae6abccf97761a15646a
4
+ data.tar.gz: 50df871acee66ab97b06afdae4a5d1e2de9c46f3
5
5
  SHA512:
6
- metadata.gz: 608359e56103200d49bb68abf00660e9c415153d1d4df3200fac45bd0abc30685d61fc52bd36bf24918591b930c80b2e4c77f85e041ba6be7e893471f1bcd237
7
- data.tar.gz: dcffb206345ecca1015353be4c60264f79eaf20a1349627ea127989d8a53871c7bef7a47caef407ba9f919f918e8c1e3b65bf00f02b8896a3626cd23775b622f
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' \
@@ -1,3 +1,3 @@
1
1
  module ShopifyAPI
2
- VERSION = "4.3.8"
2
+ VERSION = "4.3.9"
3
3
  end
@@ -1,21 +1,35 @@
1
1
  class ResourceFeedbackTest < Test::Unit::TestCase
2
- def test_save_with_resource_feedbacks_endpoint
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 'resource_feedbacks', method: :post, body: body
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 test_save_with_product_id_resource_feedbacks_endpoint
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/resource_feedbacks', method: :post, body: body
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 'resource_feedbacks', method: :post, body: body
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.8
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-21 00:00:00.000000000 Z
11
+ date: 2017-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource