shopify_api 4.5.0 → 4.6.0
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 +4 -4
- data/CHANGELOG +4 -0
- data/lib/shopify_api/resources/report.rb +4 -0
- data/lib/shopify_api/version.rb +1 -1
- data/test/fixtures/report.json +9 -0
- data/test/fixtures/reports.json +11 -0
- data/test/report_test.rb +35 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa938b8a6b1e983a6b569571b2f0c8d191a374c6
|
4
|
+
data.tar.gz: e15f2478aeaac3834b047a007ee30847fb947896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f3cbeba1953b0c4b65e8a0f62909e804cc59c3d8ea1d136c74604d64c98ed9cee9cd403fb350b885d2eab7cae71d1a625ec1c7cbc9f97b0fc2d7f9a5d1ce64f
|
7
|
+
data.tar.gz: f7deef5d9438c1b6a7e000aa59e9580c6194e47a2268e95c10dc6138201691acb73faac2c27140611688aa1857cbcf7e9b7fd0f4b94f6691a5246d425f658380
|
data/CHANGELOG
CHANGED
data/lib/shopify_api/version.rb
CHANGED
@@ -0,0 +1,9 @@
|
|
1
|
+
{
|
2
|
+
"report": {
|
3
|
+
"id": 987,
|
4
|
+
"name": "Custom App Report",
|
5
|
+
"shopify_ql": "SHOW quantity_count, total_sales BY product_type, vendor, product_title FROM products SINCE -1m UNTIL -0m ORDER BY total_sales DESC",
|
6
|
+
"updated_at": "2017-04-12T14:00:54-04:00",
|
7
|
+
"category": "custom_app_reports"
|
8
|
+
}
|
9
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{
|
2
|
+
"reports": [
|
3
|
+
{
|
4
|
+
"id": 987,
|
5
|
+
"name": "Custom App Report",
|
6
|
+
"shopify_ql": "SHOW quantity_count, total_sales BY product_type, vendor, product_title FROM products SINCE -1m UNTIL -0m ORDER BY total_sales DESC",
|
7
|
+
"updated_at": "2017-04-12T14:00:54-04:00",
|
8
|
+
"category": "custom_app_reports"
|
9
|
+
}
|
10
|
+
]
|
11
|
+
}
|
data/test/report_test.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ReportTest < Test::Unit::TestCase
|
4
|
+
test 'get should get a report' do
|
5
|
+
fake 'reports/987', method: :get, status: 200, body: load_fixture('report')
|
6
|
+
|
7
|
+
report = ShopifyAPI::Report.find(987)
|
8
|
+
assert_equal 987, report.id
|
9
|
+
end
|
10
|
+
|
11
|
+
test 'get all should get all reports' do
|
12
|
+
fake 'reports', method: :get, status: 200, body: load_fixture('reports')
|
13
|
+
|
14
|
+
reports = ShopifyAPI::Report.all
|
15
|
+
assert_equal 'custom_app_reports', reports.first.category
|
16
|
+
end
|
17
|
+
|
18
|
+
test 'create should create a report' do
|
19
|
+
fake 'reports', method: :post, status: 201, body: load_fixture('report')
|
20
|
+
|
21
|
+
report = ShopifyAPI::Report.create(
|
22
|
+
name: 'Custom App Report',
|
23
|
+
shopify_ql: 'SHOW quantity_count, total_sales BY product_type, vendor, product_title FROM products SINCE -1m UNTIL -0m ORDER BY total_sales DESC'
|
24
|
+
)
|
25
|
+
assert_equal 'custom_app_reports', report.category
|
26
|
+
end
|
27
|
+
|
28
|
+
test 'delete should delete report' do
|
29
|
+
fake 'reports/987', method: :get, status: 200, body: load_fixture('report')
|
30
|
+
fake 'reports/987', method: :delete, status: 200, body: '[]'
|
31
|
+
|
32
|
+
report = ShopifyAPI::Report.find(987)
|
33
|
+
assert report.destroy
|
34
|
+
end
|
35
|
+
end
|
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.6.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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- lib/shopify_api/resources/recurring_application_charge.rb
|
203
203
|
- lib/shopify_api/resources/redirect.rb
|
204
204
|
- lib/shopify_api/resources/refund.rb
|
205
|
+
- lib/shopify_api/resources/report.rb
|
205
206
|
- lib/shopify_api/resources/resource_feedback.rb
|
206
207
|
- lib/shopify_api/resources/rule.rb
|
207
208
|
- lib/shopify_api/resources/script_tag.rb
|
@@ -304,6 +305,8 @@ files:
|
|
304
305
|
- test/fixtures/recurring_application_charges.json
|
305
306
|
- test/fixtures/redirect.json
|
306
307
|
- test/fixtures/refund.json
|
308
|
+
- test/fixtures/report.json
|
309
|
+
- test/fixtures/reports.json
|
307
310
|
- test/fixtures/script_tag.json
|
308
311
|
- test/fixtures/script_tags.json
|
309
312
|
- test/fixtures/shipping_zones.json
|
@@ -340,6 +343,7 @@ files:
|
|
340
343
|
- test/recurring_application_charge_test.rb
|
341
344
|
- test/redirect_test.rb
|
342
345
|
- test/refund_test.rb
|
346
|
+
- test/report_test.rb
|
343
347
|
- test/resource_feedback_test.rb
|
344
348
|
- test/script_tag_test.rb
|
345
349
|
- test/session_test.rb
|