shopify_api 4.4.0 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/shopify_api/resources/marketing_event.rb +4 -0
- data/lib/shopify_api/version.rb +1 -1
- data/test/fixtures/marketing_event.json +28 -0
- data/test/fixtures/marketing_events.json +54 -0
- data/test/marketing_event_test.rb +49 -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: bae3ed256a8dbba365e091aab85fc4cde1795d6c
|
4
|
+
data.tar.gz: 2226bb7ace8c22a2dfaa8ba1ef36a33f3e7d9631
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c72244bf2a2bb65af7ec6a90673ed46f728f1fc8dd0ebc791e66385e1bb27400eb26c54888fd58ad604842f73dcf6d9482656524408b4c88c347740f55049763
|
7
|
+
data.tar.gz: 93c898643b38e38190514270a280cff342ea403aeeac9726da47eae31a911e9c27ee3bddff0e50187e5c04825fce6ae18e60ef87c98a3e9a77bc23accfb4ef44
|
data/CHANGELOG
CHANGED
data/lib/shopify_api/version.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"marketing_event": {
|
3
|
+
"id": 1,
|
4
|
+
"started_at": "2011-12-31T19:00:00-05:00",
|
5
|
+
"ended_at": null,
|
6
|
+
"event_target": "facebook",
|
7
|
+
"event_type": "post",
|
8
|
+
"scheduled_to_end_at": null,
|
9
|
+
"budget": "10.11",
|
10
|
+
"budget_type": "daily",
|
11
|
+
"currency": "GBP",
|
12
|
+
"utm_campaign": "1234567890",
|
13
|
+
"utm_source": "facebook",
|
14
|
+
"utm_medium": "facebook-post",
|
15
|
+
"utm_content": null,
|
16
|
+
"utm_term": null,
|
17
|
+
"manage_url": null,
|
18
|
+
"preview_url": null,
|
19
|
+
"description": null,
|
20
|
+
"marketing_channel": "social",
|
21
|
+
"paid": false,
|
22
|
+
"referring_domain": "facebook.com",
|
23
|
+
"breadcrumb_id": null,
|
24
|
+
"marketed_resources": [
|
25
|
+
{ "type": "product", "id": 1 }
|
26
|
+
]
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
{
|
2
|
+
"marketing_event": [{
|
3
|
+
"id": 1,
|
4
|
+
"started_at": "2011-12-31T19:00:00-05:00",
|
5
|
+
"ended_at": null,
|
6
|
+
"event_target": "facebook",
|
7
|
+
"event_type": "post",
|
8
|
+
"scheduled_to_end_at": null,
|
9
|
+
"budget": "10.11",
|
10
|
+
"budget_type": "daily",
|
11
|
+
"currency": "GBP",
|
12
|
+
"utm_campaign": "1234567890",
|
13
|
+
"utm_source": "facebook",
|
14
|
+
"utm_medium": "facebook-post",
|
15
|
+
"utm_content": null,
|
16
|
+
"utm_term": null,
|
17
|
+
"manage_url": null,
|
18
|
+
"preview_url": null,
|
19
|
+
"description": null,
|
20
|
+
"marketing_channel": "social",
|
21
|
+
"paid": false,
|
22
|
+
"referring_domain": "facebook.com",
|
23
|
+
"breadcrumb_id": null,
|
24
|
+
"marketed_resources": [
|
25
|
+
{ "type": "product", "id": 1 }
|
26
|
+
]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"id": 2,
|
30
|
+
"started_at": "2011-12-31T19:00:00-05:00",
|
31
|
+
"ended_at": null,
|
32
|
+
"event_target": "facebook",
|
33
|
+
"event_type": "post",
|
34
|
+
"scheduled_to_end_at": null,
|
35
|
+
"budget": "10.11",
|
36
|
+
"budget_type": "daily",
|
37
|
+
"currency": "USD",
|
38
|
+
"utm_campaign": "1234567891",
|
39
|
+
"utm_source": "facebook",
|
40
|
+
"utm_medium": "facebook-post",
|
41
|
+
"utm_content": null,
|
42
|
+
"utm_term": null,
|
43
|
+
"manage_url": null,
|
44
|
+
"preview_url": null,
|
45
|
+
"description": null,
|
46
|
+
"marketing_channel": "social",
|
47
|
+
"paid": false,
|
48
|
+
"referring_domain": "facebook.com",
|
49
|
+
"breadcrumb_id": null,
|
50
|
+
"marketed_resources": [
|
51
|
+
{ "type": "product", "id": 2 }
|
52
|
+
]
|
53
|
+
}]
|
54
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class MarketingEventTest < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_get_marketing_events
|
6
|
+
fake "marketing_events", :method => :get, :body => load_fixture('marketing_events')
|
7
|
+
marketing_events = ShopifyAPI::MarketingEvent.all
|
8
|
+
assert_equal 2, marketing_events.size
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_get_marketing_event
|
12
|
+
fake "marketing_events/1", :method => :get, :body => load_fixture('marketing_event')
|
13
|
+
marketing_event = ShopifyAPI::MarketingEvent.find(1)
|
14
|
+
assert_equal 1, marketing_event.id
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_create_marketing_event
|
18
|
+
fake "marketing_events", :method => :post, :body => load_fixture('marketing_event')
|
19
|
+
marketing_event = ShopifyAPI::MarketingEvent.new
|
20
|
+
marketing_event.currency_code = 'GBP'
|
21
|
+
marketing_event.event_target = 'facebook'
|
22
|
+
marketing_event.event_type = 'post'
|
23
|
+
marketing_event.save
|
24
|
+
|
25
|
+
assert_equal 'facebook', marketing_event.event_target
|
26
|
+
assert_equal 1, marketing_event.id
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_delete_marketing_event
|
30
|
+
fake "marketing_events/1", :method => :get, :body => load_fixture('marketing_event')
|
31
|
+
fake "marketing_events/1", :method => :delete, :body => "destroyed"
|
32
|
+
marketing_event = ShopifyAPI::MarketingEvent.find(1)
|
33
|
+
assert marketing_event.destroy
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_update_marketing_event
|
37
|
+
fake 'marketing_events/1', :method => :get, :status => 200, :body => load_fixture('marketing_event')
|
38
|
+
marketing_event = ShopifyAPI::MarketingEvent.find(1)
|
39
|
+
marketing_event.currency = 'USD'
|
40
|
+
fake 'marketing_events/1', :method => :put, :status => 200, :body => load_fixture('marketing_event')
|
41
|
+
assert marketing_event.save
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_count_marketing_events
|
45
|
+
fake "marketing_events/count", :method => :get, :body => '{"count": 2}'
|
46
|
+
marketing_events_count = ShopifyAPI::MarketingEvent.get(:count)
|
47
|
+
assert_equal 2, marketing_events_count
|
48
|
+
end
|
49
|
+
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.5.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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -185,6 +185,7 @@ files:
|
|
185
185
|
- lib/shopify_api/resources/image.rb
|
186
186
|
- lib/shopify_api/resources/line_item.rb
|
187
187
|
- lib/shopify_api/resources/location.rb
|
188
|
+
- lib/shopify_api/resources/marketing_event.rb
|
188
189
|
- lib/shopify_api/resources/metafield.rb
|
189
190
|
- lib/shopify_api/resources/note_attribute.rb
|
190
191
|
- lib/shopify_api/resources/o_auth.rb
|
@@ -284,6 +285,8 @@ files:
|
|
284
285
|
- test/fixtures/gift_card_disabled.json
|
285
286
|
- test/fixtures/image.json
|
286
287
|
- test/fixtures/images.json
|
288
|
+
- test/fixtures/marketing_event.json
|
289
|
+
- test/fixtures/marketing_events.json
|
287
290
|
- test/fixtures/metafield.json
|
288
291
|
- test/fixtures/metafields.json
|
289
292
|
- test/fixtures/o_auth_revoke.json
|
@@ -326,6 +329,7 @@ files:
|
|
326
329
|
- test/gift_card_test.rb
|
327
330
|
- test/image_test.rb
|
328
331
|
- test/limits_test.rb
|
332
|
+
- test/marketing_event_test.rb
|
329
333
|
- test/metafield_test.rb
|
330
334
|
- test/o_auth_test.rb
|
331
335
|
- test/order_risk_test.rb
|