wix-hive-ruby 0.9.2 → 1.0.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/LICENSE.txt +1 -1
- data/README.md +38 -11
- data/e2e/activities_api_spec.rb +97 -3
- data/e2e/contacts_api_spec.rb +74 -28
- data/e2e/e2e_helper.rb +7 -3
- data/e2e/redirects_api_spec.rb +7 -0
- data/e2e/sites_api_spec.rb +11 -0
- data/lib/hive/activities/contact/contact_create_activity.rb +1 -11
- data/lib/hive/activities/contact/contact_form_activity.rb +2 -2
- data/lib/hive/activities/contact/subscription_form_activity.rb +38 -0
- data/lib/hive/activities/conversion/conversion_complete_activity.rb +1 -1
- data/lib/hive/activities/e_commerce/cart_add_activity.rb +55 -0
- data/lib/hive/activities/e_commerce/cart_checkout_activity.rb +18 -0
- data/lib/hive/activities/e_commerce/cart_remove_activity.rb +22 -0
- data/lib/hive/activities/e_commerce/purchase_activity.rb +17 -1
- data/lib/hive/activities/factory.rb +11 -21
- data/lib/hive/activities/hotels/hotels_cancel_activity.rb +1 -1
- data/lib/hive/activities/hotels/hotels_confirmation_activity.rb +1 -1
- data/lib/hive/activities/hotels/hotels_purchase_activity.rb +1 -1
- data/lib/hive/activities/hotels/hotels_purchase_failed_activity.rb +1 -1
- data/lib/hive/activities/messaging/send_activity.rb +1 -1
- data/lib/hive/activities/music/album_fan_activity.rb +1 -1
- data/lib/hive/activities/music/album_played_activity.rb +1 -1
- data/lib/hive/activities/music/album_share_activity.rb +2 -2
- data/lib/hive/activities/music/track_lyrics_activity.rb +1 -1
- data/lib/hive/activities/music/track_play_activity.rb +1 -1
- data/lib/hive/activities/music/track_played_activity.rb +1 -1
- data/lib/hive/activities/music/track_share_activity.rb +2 -2
- data/lib/hive/activities/music/track_skipped_activity.rb +1 -1
- data/lib/hive/activities/scheduler/scheduler_appointment_activity.rb +12 -1
- data/lib/hive/activities/shipping/shipping_delivered_activity.rb +34 -0
- data/lib/hive/activities/shipping/shipping_shipped_activity.rb +109 -0
- data/lib/hive/activities/shipping/shipping_status_change_activity.rb +51 -0
- data/lib/hive/activities/shipping/shipping_status_changed_activity.rb +51 -0
- data/lib/hive/redirect.rb +19 -0
- data/lib/hive/rest/api.rb +4 -0
- data/lib/hive/rest/contacts.rb +2 -4
- data/lib/hive/rest/redirects.rb +13 -0
- data/lib/hive/rest/sites.rb +17 -0
- data/lib/hive/site.rb +33 -0
- data/lib/hive/version.rb +3 -3
- data/spec/hive/activities/contact/subscription_form_activity_spec.rb +15 -0
- data/spec/hive/activities/e_commerce/purchase_activity_spec.rb +4 -0
- data/spec/hive/activities/factory_spec.rb +16 -0
- data/spec/hive/activities/shipping/shipping_delivered_acitivty_spec.rb +10 -0
- data/spec/hive/activities/shipping/shipping_shipped_acitivty_spec.rb +21 -0
- data/spec/hive/activities/shipping/shipping_status_changed_acitivty_spec.rb +10 -0
- data/spec/hive/rest/contacts_spec.rb +10 -9
- data/spec/hive/rest/redirects_spec.rb +12 -0
- data/spec/hive/rest/sites_spec.rb +17 -0
- metadata +30 -2
@@ -36,6 +36,10 @@ describe Hive::REST::Contacts do
|
|
36
36
|
it 'without email or phone' do
|
37
37
|
expect { contacts.upsert_contact(nothing: nil) }.to raise_error(ArgumentError)
|
38
38
|
end
|
39
|
+
|
40
|
+
it 'without email or phone but with userSessionToken' do
|
41
|
+
expect { contacts.upsert_contact(userSessionToken: 'something') }.to raise_error(ArgumentError)
|
42
|
+
end
|
39
43
|
end
|
40
44
|
|
41
45
|
it '.contacts_tags' do
|
@@ -48,16 +52,13 @@ describe Hive::REST::Contacts do
|
|
48
52
|
contacts.contacts_subscribers
|
49
53
|
end
|
50
54
|
|
51
|
-
it '.
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
+
it '.patch_contact' do
|
56
|
+
contact_id = '1234'
|
57
|
+
patch_operations = double('PatchOperations')
|
55
58
|
allow(Time).to receive(:now) { time_now }
|
56
|
-
expect(
|
57
|
-
expect(contacts).to receive(:perform_with_object).with(:
|
58
|
-
|
59
|
-
pending('HAPI-3')
|
60
|
-
contacts.update_contact(id, contact)
|
59
|
+
expect(patch_operations).to receive(:to_json).and_return('mock')
|
60
|
+
expect(contacts).to receive(:perform_with_object).with(:patch, "v1/contacts/#{contact_id}", Hive::Contact, body: 'mock', params: {modifiedAt: time_now.iso8601(3)}).and_return(instance_double(Faraday::Response, body: 'mock'))
|
61
|
+
contacts.patch_contact(contact_id, patch_operations, time_now.iso8601(3))
|
61
62
|
end
|
62
63
|
|
63
64
|
it '.update_contact_name' do
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hive::REST::Redirects do
|
4
|
+
|
5
|
+
subject(:redirects) { (Class.new { include Hive::Util; include Hive::REST::Redirects }).new }
|
6
|
+
|
7
|
+
it '.redirects' do
|
8
|
+
expect(redirects).to receive(:perform_with_object).with(:get, 'v1/redirects', Hive::Redirects, params: {}).and_return(instance_double(Faraday::Response, body: 'mock'))
|
9
|
+
redirects.redirects
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hive::REST::Sites do
|
4
|
+
|
5
|
+
subject(:sites) { (Class.new { include Hive::Util; include Hive::REST::Sites }).new }
|
6
|
+
|
7
|
+
it '.sites_site' do
|
8
|
+
expect(sites).to receive(:perform_with_object).with(:get, 'v1/sites/site', Hive::Site, params: {}).and_return(instance_double(Faraday::Response, body: 'mock'))
|
9
|
+
sites.sites_site
|
10
|
+
end
|
11
|
+
|
12
|
+
it '.sites_site_pages' do
|
13
|
+
expect(sites).to receive(:perform_with_object).with(:get, 'v1/sites/site/pages', Hive::SitePages, params: {}).and_return(instance_double(Faraday::Response, body: 'mock'))
|
14
|
+
sites.sites_site_pages
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wix-hive-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksandar Tomovski
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -286,9 +286,15 @@ files:
|
|
286
286
|
- e2e/contacts_api_spec.rb
|
287
287
|
- e2e/e2e_helper.rb
|
288
288
|
- e2e/insights_api_spec.rb
|
289
|
+
- e2e/redirects_api_spec.rb
|
290
|
+
- e2e/sites_api_spec.rb
|
289
291
|
- lib/hive/activities/contact/contact_create_activity.rb
|
290
292
|
- lib/hive/activities/contact/contact_form_activity.rb
|
293
|
+
- lib/hive/activities/contact/subscription_form_activity.rb
|
291
294
|
- lib/hive/activities/conversion/conversion_complete_activity.rb
|
295
|
+
- lib/hive/activities/e_commerce/cart_add_activity.rb
|
296
|
+
- lib/hive/activities/e_commerce/cart_checkout_activity.rb
|
297
|
+
- lib/hive/activities/e_commerce/cart_remove_activity.rb
|
292
298
|
- lib/hive/activities/e_commerce/purchase_activity.rb
|
293
299
|
- lib/hive/activities/factory.rb
|
294
300
|
- lib/hive/activities/hotels/hotels_cancel_activity.rb
|
@@ -305,6 +311,10 @@ files:
|
|
305
311
|
- lib/hive/activities/music/track_share_activity.rb
|
306
312
|
- lib/hive/activities/music/track_skipped_activity.rb
|
307
313
|
- lib/hive/activities/scheduler/scheduler_appointment_activity.rb
|
314
|
+
- lib/hive/activities/shipping/shipping_delivered_activity.rb
|
315
|
+
- lib/hive/activities/shipping/shipping_shipped_activity.rb
|
316
|
+
- lib/hive/activities/shipping/shipping_status_change_activity.rb
|
317
|
+
- lib/hive/activities/shipping/shipping_status_changed_activity.rb
|
308
318
|
- lib/hive/activity.rb
|
309
319
|
- lib/hive/activity_summary.rb
|
310
320
|
- lib/hive/connect/request/wix_api_request.rb
|
@@ -317,16 +327,21 @@ files:
|
|
317
327
|
- lib/hive/errors.rb
|
318
328
|
- lib/hive/extensions/hashie_hash.rb
|
319
329
|
- lib/hive/extensions/hashie_validate_enum.rb
|
330
|
+
- lib/hive/redirect.rb
|
320
331
|
- lib/hive/rest/activities.rb
|
321
332
|
- lib/hive/rest/api.rb
|
322
333
|
- lib/hive/rest/contacts.rb
|
323
334
|
- lib/hive/rest/insights.rb
|
335
|
+
- lib/hive/rest/redirects.rb
|
336
|
+
- lib/hive/rest/sites.rb
|
337
|
+
- lib/hive/site.rb
|
324
338
|
- lib/hive/util.rb
|
325
339
|
- lib/hive/version.rb
|
326
340
|
- lib/wix-hive-ruby.rb
|
327
341
|
- samples/quick_start.rb
|
328
342
|
- spec/hive/activities/contact/contact_create_activity_spec.rb
|
329
343
|
- spec/hive/activities/contact/contact_form_activity_spec.rb
|
344
|
+
- spec/hive/activities/contact/subscription_form_activity_spec.rb
|
330
345
|
- spec/hive/activities/conversion/conversion_complete_activity_spec.rb
|
331
346
|
- spec/hive/activities/e_commerce/purchase_activity_spec.rb
|
332
347
|
- spec/hive/activities/factory_spec.rb
|
@@ -336,6 +351,9 @@ files:
|
|
336
351
|
- spec/hive/activities/hotels/hotels_purchase_failed_activity_spec.rb
|
337
352
|
- spec/hive/activities/messaging/send_activity_spec.rb
|
338
353
|
- spec/hive/activities/scheduler/scheduler_appointment_activity_spec.rb
|
354
|
+
- spec/hive/activities/shipping/shipping_delivered_acitivty_spec.rb
|
355
|
+
- spec/hive/activities/shipping/shipping_shipped_acitivty_spec.rb
|
356
|
+
- spec/hive/activities/shipping/shipping_status_changed_acitivty_spec.rb
|
339
357
|
- spec/hive/activity_spec.rb
|
340
358
|
- spec/hive/connect/request/wix_api_request_spec.rb
|
341
359
|
- spec/hive/connect/response/error_spec.rb
|
@@ -348,6 +366,8 @@ files:
|
|
348
366
|
- spec/hive/rest/activities_spec.rb
|
349
367
|
- spec/hive/rest/contacts_spec.rb
|
350
368
|
- spec/hive/rest/insights_spec.rb
|
369
|
+
- spec/hive/rest/redirects_spec.rb
|
370
|
+
- spec/hive/rest/sites_spec.rb
|
351
371
|
- spec/hive/util_spec.rb
|
352
372
|
- spec/spec_helper.rb
|
353
373
|
- wix-hive-ruby.gemspec
|
@@ -380,8 +400,11 @@ test_files:
|
|
380
400
|
- e2e/contacts_api_spec.rb
|
381
401
|
- e2e/e2e_helper.rb
|
382
402
|
- e2e/insights_api_spec.rb
|
403
|
+
- e2e/redirects_api_spec.rb
|
404
|
+
- e2e/sites_api_spec.rb
|
383
405
|
- spec/hive/activities/contact/contact_create_activity_spec.rb
|
384
406
|
- spec/hive/activities/contact/contact_form_activity_spec.rb
|
407
|
+
- spec/hive/activities/contact/subscription_form_activity_spec.rb
|
385
408
|
- spec/hive/activities/conversion/conversion_complete_activity_spec.rb
|
386
409
|
- spec/hive/activities/e_commerce/purchase_activity_spec.rb
|
387
410
|
- spec/hive/activities/factory_spec.rb
|
@@ -391,6 +414,9 @@ test_files:
|
|
391
414
|
- spec/hive/activities/hotels/hotels_purchase_failed_activity_spec.rb
|
392
415
|
- spec/hive/activities/messaging/send_activity_spec.rb
|
393
416
|
- spec/hive/activities/scheduler/scheduler_appointment_activity_spec.rb
|
417
|
+
- spec/hive/activities/shipping/shipping_delivered_acitivty_spec.rb
|
418
|
+
- spec/hive/activities/shipping/shipping_shipped_acitivty_spec.rb
|
419
|
+
- spec/hive/activities/shipping/shipping_status_changed_acitivty_spec.rb
|
394
420
|
- spec/hive/activity_spec.rb
|
395
421
|
- spec/hive/connect/request/wix_api_request_spec.rb
|
396
422
|
- spec/hive/connect/response/error_spec.rb
|
@@ -403,6 +429,8 @@ test_files:
|
|
403
429
|
- spec/hive/rest/activities_spec.rb
|
404
430
|
- spec/hive/rest/contacts_spec.rb
|
405
431
|
- spec/hive/rest/insights_spec.rb
|
432
|
+
- spec/hive/rest/redirects_spec.rb
|
433
|
+
- spec/hive/rest/sites_spec.rb
|
406
434
|
- spec/hive/util_spec.rb
|
407
435
|
- spec/spec_helper.rb
|
408
436
|
has_rdoc:
|