shopify_api 4.5.0 → 4.6.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: bae3ed256a8dbba365e091aab85fc4cde1795d6c
4
- data.tar.gz: 2226bb7ace8c22a2dfaa8ba1ef36a33f3e7d9631
3
+ metadata.gz: aa938b8a6b1e983a6b569571b2f0c8d191a374c6
4
+ data.tar.gz: e15f2478aeaac3834b047a007ee30847fb947896
5
5
  SHA512:
6
- metadata.gz: c72244bf2a2bb65af7ec6a90673ed46f728f1fc8dd0ebc791e66385e1bb27400eb26c54888fd58ad604842f73dcf6d9482656524408b4c88c347740f55049763
7
- data.tar.gz: 93c898643b38e38190514270a280cff342ea403aeeac9726da47eae31a911e9c27ee3bddff0e50187e5c04825fce6ae18e60ef87c98a3e9a77bc23accfb4ef44
6
+ metadata.gz: 3f3cbeba1953b0c4b65e8a0f62909e804cc59c3d8ea1d136c74604d64c98ed9cee9cd403fb350b885d2eab7cae71d1a625ec1c7cbc9f97b0fc2d7f9a5d1ce64f
7
+ data.tar.gz: f7deef5d9438c1b6a7e000aa59e9580c6194e47a2268e95c10dc6138201691acb73faac2c27140611688aa1857cbcf7e9b7fd0f4b94f6691a5246d425f658380
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == Version 4.6.0
2
+
3
+ * Added `ShopifyAPI::Report`
4
+
1
5
  == Version 4.5.0
2
6
 
3
7
  * Added `ShopifyAPI::MarketingEvent`
@@ -0,0 +1,4 @@
1
+ module ShopifyAPI
2
+ class Report < Base
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module ShopifyAPI
2
- VERSION = "4.5.0"
2
+ VERSION = "4.6.0"
3
3
  end
@@ -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
+ }
@@ -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.5.0
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 00:00:00.000000000 Z
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