shopify_api 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG
CHANGED
@@ -10,5 +10,13 @@ module ActiveResource
|
|
10
10
|
@headers
|
11
11
|
end
|
12
12
|
end
|
13
|
+
# https://github.com/rails/activeresource/commit/dfef85ce8f653f75673631b2950fcdb0781c313c
|
14
|
+
def self.delete(id, options = {})
|
15
|
+
connection.delete(element_path(id, options), headers)
|
16
|
+
end
|
17
|
+
def self.build(attributes = {})
|
18
|
+
attrs = self.format.decode(connection.get("#{new_element_path}", headers).body).merge(attributes)
|
19
|
+
self.new(attrs)
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
data/lib/shopify_api/version.rb
CHANGED
data/test/base_test.rb
CHANGED
@@ -47,4 +47,18 @@ class BaseTest < Test::Unit::TestCase
|
|
47
47
|
assert_equal 'token2', ShopifyAPI::Shop.headers['X-Shopify-Access-Token']
|
48
48
|
end
|
49
49
|
|
50
|
-
|
50
|
+
test "#delete should send custom headers with request" do
|
51
|
+
ShopifyAPI::Base.activate_session @session1
|
52
|
+
ShopifyAPI::Base.expects(:headers).returns({'X-Custom' => 'abc'})
|
53
|
+
ShopifyAPI::Base.connection.expects(:delete).with('/admin/bases/1.json', {'X-Custom' => 'abc'})
|
54
|
+
ShopifyAPI::Base.delete "1"
|
55
|
+
end
|
56
|
+
|
57
|
+
test "#build should send custom headers with request" do
|
58
|
+
ShopifyAPI::Base.activate_session @session1
|
59
|
+
ShopifyAPI::Base.expects(:headers).returns({'X-Custom' => 'abc'})
|
60
|
+
ShopifyAPI::Base.connection.expects(:delete).with('/admin/bases/1.json', {'X-Custom' => 'abc'})
|
61
|
+
ShopifyAPI::Base.delete "1"
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activeresource
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/shopify_api/resources/billing_address.rb
|
118
118
|
- lib/shopify_api/resources/blog.rb
|
119
119
|
- lib/shopify_api/resources/cart.rb
|
120
|
+
- lib/shopify_api/resources/checkout.rb
|
120
121
|
- lib/shopify_api/resources/collect.rb
|
121
122
|
- lib/shopify_api/resources/comment.rb
|
122
123
|
- lib/shopify_api/resources/country.rb
|