braze_ruby 0.3.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +57 -0
  3. data/.circleci/gem_credentials +2 -0
  4. data/.circleci/setup-rubygems +6 -0
  5. data/.gitignore +12 -19
  6. data/.standard.yml +1 -0
  7. data/Gemfile +1 -2
  8. data/LICENSE.txt +17 -18
  9. data/README.md +49 -2
  10. data/Rakefile +2 -1
  11. data/bin/release +16 -0
  12. data/braze_ruby.gemspec +28 -31
  13. data/lib/braze_ruby.rb +4 -4
  14. data/lib/braze_ruby/api.rb +20 -14
  15. data/lib/braze_ruby/deprecated.rb +4 -4
  16. data/lib/braze_ruby/endpoints.rb +10 -7
  17. data/lib/braze_ruby/endpoints/campaigns.rb +1 -1
  18. data/lib/braze_ruby/endpoints/canvas.rb +2 -2
  19. data/lib/braze_ruby/endpoints/create_user_aliases.rb +19 -0
  20. data/lib/braze_ruby/endpoints/delete_users.rb +2 -2
  21. data/lib/braze_ruby/endpoints/email_status.rb +1 -1
  22. data/lib/braze_ruby/endpoints/email_sync.rb +2 -2
  23. data/lib/braze_ruby/endpoints/identify_users.rb +2 -2
  24. data/lib/braze_ruby/endpoints/remove_external_ids.rb +19 -0
  25. data/lib/braze_ruby/endpoints/rename_external_ids.rb +19 -0
  26. data/lib/braze_ruby/endpoints/schedule_messages.rb +1 -1
  27. data/lib/braze_ruby/endpoints/send_messages.rb +1 -1
  28. data/lib/braze_ruby/endpoints/subscription.rb +3 -4
  29. data/lib/braze_ruby/endpoints/track_users.rb +5 -5
  30. data/lib/braze_ruby/http.rb +21 -8
  31. data/lib/braze_ruby/rest.rb +20 -17
  32. data/lib/braze_ruby/rest/base.rb +5 -3
  33. data/lib/braze_ruby/rest/canvas_details.rb +4 -6
  34. data/lib/braze_ruby/rest/create_user_aliases.rb +13 -0
  35. data/lib/braze_ruby/rest/delete_users.rb +3 -4
  36. data/lib/braze_ruby/rest/email_hard_bounces.rb +4 -6
  37. data/lib/braze_ruby/rest/email_status.rb +6 -8
  38. data/lib/braze_ruby/rest/email_unsubscribes.rb +4 -6
  39. data/lib/braze_ruby/rest/export_users.rb +9 -11
  40. data/lib/braze_ruby/rest/identify_users.rb +3 -4
  41. data/lib/braze_ruby/rest/list_segments.rb +2 -4
  42. data/lib/braze_ruby/rest/remove_external_ids.rb +13 -0
  43. data/lib/braze_ruby/rest/rename_external_ids.rb +13 -0
  44. data/lib/braze_ruby/rest/schedule_messages.rb +9 -11
  45. data/lib/braze_ruby/rest/send_messages.rb +6 -8
  46. data/lib/braze_ruby/rest/subscription_status_get.rb +4 -6
  47. data/lib/braze_ruby/rest/subscription_status_set.rb +4 -6
  48. data/lib/braze_ruby/rest/subscription_user_status.rb +4 -6
  49. data/lib/braze_ruby/rest/track_users.rb +5 -6
  50. data/lib/braze_ruby/rest/trigger_campaign_send.rb +4 -8
  51. data/lib/braze_ruby/rest/trigger_canvas_send.rb +4 -6
  52. data/lib/braze_ruby/version.rb +1 -1
  53. metadata +61 -175
  54. data/.github/workflows/ci.yml +0 -19
  55. data/Gemfile.lock +0 -78
  56. data/spec/braze_ruby/api_spec.rb +0 -6
  57. data/spec/braze_ruby/endpoints/delete_users_spec.rb +0 -31
  58. data/spec/braze_ruby/endpoints/track_users_spec.rb +0 -74
  59. data/spec/braze_ruby/rest/delete_users_spec.rb +0 -22
  60. data/spec/braze_ruby/rest/email_status_spec.rb +0 -21
  61. data/spec/braze_ruby/rest/export_users_spec.rb +0 -21
  62. data/spec/braze_ruby/rest/identify_users_spec.rb +0 -23
  63. data/spec/braze_ruby/rest/schedule_messages_spec.rb +0 -38
  64. data/spec/braze_ruby/rest/send_messages_spec.rb +0 -35
  65. data/spec/braze_ruby/rest/track_users_spec.rb +0 -26
  66. data/spec/factories.rb +0 -38
  67. data/spec/fixtures/responses/campaigns/trigger_send/sends_an_email.yml +0 -69
  68. data/spec/fixtures/responses/canvas/details/returns_error_when_no_canvas.yml +0 -67
  69. data/spec/fixtures/responses/canvas/trigger_send/sends_a_canvas.yml +0 -69
  70. data/spec/fixtures/responses/delete_users/unauthorized/responds_with_unauthorized.yml +0 -66
  71. data/spec/fixtures/responses/delete_users/with_success/responds_with_created.yml +0 -69
  72. data/spec/fixtures/responses/delete_users/with_success/responds_with_success_message.yml +0 -69
  73. data/spec/fixtures/responses/email_status/existing_email/responds_with_created.yml +0 -69
  74. data/spec/fixtures/responses/email_status/existing_email/responds_with_success_message.yml +0 -69
  75. data/spec/fixtures/responses/email_status/unknown_email/responds_with_bad_request.yml +0 -69
  76. data/spec/fixtures/responses/email_status/unknown_email/responds_with_success_message.yml +0 -69
  77. data/spec/fixtures/responses/email_sync/hard_bounces/responds_with_empty_array_when_no_hard_bounces.yml +0 -73
  78. data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_empty_array_when_no_unsubscribes.yml +0 -73
  79. data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_unsubscribed_emails.yml +0 -74
  80. data/spec/fixtures/responses/export_users/by_ids/with_success/responds_with_created.yml +0 -69
  81. data/spec/fixtures/responses/export_users/by_segment/with_success/responds_with_created.yml +0 -69
  82. data/spec/fixtures/responses/identify_users/unauthorized/responds_with_unauthorized.yml +0 -66
  83. data/spec/fixtures/responses/identify_users/with_success/responds_with_created.yml +0 -69
  84. data/spec/fixtures/responses/identify_users/with_success/responds_with_success_message.yml +0 -69
  85. data/spec/fixtures/responses/list_segments/with_success/responds_with_a_list_of_segments.yml +0 -81
  86. data/spec/fixtures/responses/list_segments/with_success/responds_with_success.yml +0 -81
  87. data/spec/fixtures/responses/schedule_messages/unauthorized/responds_with_unauthorize.yml +0 -67
  88. data/spec/fixtures/responses/schedule_messages/with_success/responds_with_created.yml +0 -70
  89. data/spec/fixtures/responses/schedule_messages/with_success/responds_with_success_message.yml +0 -70
  90. data/spec/fixtures/responses/send_messages/unauthorized/responds_with_unauthorized.yml +0 -66
  91. data/spec/fixtures/responses/send_messages/with_success/responds_with_created.yml +0 -69
  92. data/spec/fixtures/responses/send_messages/with_success/responds_with_success_message.yml +0 -69
  93. data/spec/fixtures/responses/subscription/subscription_status_set/when_subscribing/subscribes_the_user.yml +0 -69
  94. data/spec/fixtures/responses/subscription/subscription_status_set/when_subscription_group_does_not_exist/returns_an_error_status.yml +0 -66
  95. data/spec/fixtures/responses/subscription/subscription_status_set/when_unsubscribing/unsubscribes_the_user.yml +0 -135
  96. data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_status_get/when_checking_subscribed_and_unsubscribed_user_status/returns_only_users_that_were_once_subscribed.yml +0 -205
  97. data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_status_get/when_group_does_not_exist/returns_an_error.yml +0 -193
  98. data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_user_status/returns_subscription_groups_and_status_for_every_group.yml +0 -207
  99. data/spec/fixtures/responses/track_users/unauthorized/responds_with_unauthorized.yml +0 -68
  100. data/spec/fixtures/responses/track_users/with_success/responds_with_created.yml +0 -71
  101. data/spec/fixtures/responses/track_users/with_success/responds_with_success_message.yml +0 -71
  102. data/spec/integrations/campaigns_spec.rb +0 -17
  103. data/spec/integrations/canvas_spec.rb +0 -26
  104. data/spec/integrations/delete_users_spec.rb +0 -31
  105. data/spec/integrations/email_status_spec.rb +0 -38
  106. data/spec/integrations/email_sync_spec.rb +0 -31
  107. data/spec/integrations/export_users_spec.rb +0 -29
  108. data/spec/integrations/identify_users_spec.rb +0 -32
  109. data/spec/integrations/list_segments_spec.rb +0 -21
  110. data/spec/integrations/schedule_messages_spec.rb +0 -33
  111. data/spec/integrations/send_messages_spec.rb +0 -32
  112. data/spec/integrations/subscription_spec.rb +0 -149
  113. data/spec/integrations/track_users_spec.rb +0 -37
  114. data/spec/spec_helper.rb +0 -33
  115. data/spec/support/factory_bot.rb +0 -12
  116. data/spec/support/integrations.rb +0 -23
  117. data/spec/support/vcr.rb +0 -18
@@ -1,207 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: "<BRAZE_REST_URL>/subscription/status/set"
6
- body:
7
- encoding: UTF-8
8
- string: '{"api_key":"<BRAZE_REST_API_KEY>","external_id":"test-gem-001","subscription_group_id":"0201b87a-ef6e-4410-9412-a298c4c1206d","subscription_state":"subscribed"}'
9
- headers:
10
- Content-Type:
11
- - application/json
12
- Accept:
13
- - application/json
14
- User-Agent:
15
- - Braze Ruby gem v0.2.2
16
- Accept-Encoding:
17
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
- response:
19
- status:
20
- code: 201
21
- message: Created
22
- headers:
23
- Cache-Control:
24
- - max-age=0, private, must-revalidate
25
- Content-Type:
26
- - application/json
27
- Etag:
28
- - W/"838a7c62adda8d131d694ae13ba2c5b7"
29
- Server:
30
- - nginx
31
- Strict-Transport-Security:
32
- - max-age=0; includeSubDomains
33
- - max-age=31536000; includeSubDomains
34
- X-Ratelimit-Limit:
35
- - '250000'
36
- X-Ratelimit-Remaining:
37
- - '249986'
38
- X-Ratelimit-Reset:
39
- - '1574409600'
40
- X-Request-Id:
41
- - a5ba5ff1-a40c-471d-af9f-05cbf4b35e9c
42
- X-Runtime:
43
- - '0.010196'
44
- Content-Length:
45
- - '46'
46
- Accept-Ranges:
47
- - bytes
48
- Date:
49
- - Fri, 22 Nov 2019 07:59:44 GMT
50
- Via:
51
- - 1.1 varnish
52
- Connection:
53
- - keep-alive
54
- X-Served-By:
55
- - cache-hhn4074-HHN
56
- X-Cache:
57
- - MISS
58
- X-Cache-Hits:
59
- - '0'
60
- X-Timer:
61
- - S1574409584.278113,VS0,VE18
62
- Vary:
63
- - Origin,Accept-Encoding
64
- body:
65
- encoding: ASCII-8BIT
66
- string: '{"message":"success"}'
67
- http_version:
68
- recorded_at: Fri, 22 Nov 2019 07:59:44 GMT
69
- - request:
70
- method: post
71
- uri: "<BRAZE_REST_URL>/subscription/status/set"
72
- body:
73
- encoding: UTF-8
74
- string: '{"api_key":"<BRAZE_REST_API_KEY>","external_id":"test-gem-002","subscription_group_id":"0201b87a-ef6e-4410-9412-a298c4c1206d","subscription_state":"unsubscribed"}'
75
- headers:
76
- Content-Type:
77
- - application/json
78
- Accept:
79
- - application/json
80
- User-Agent:
81
- - Braze Ruby gem v0.2.2
82
- Accept-Encoding:
83
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
84
- response:
85
- status:
86
- code: 201
87
- message: Created
88
- headers:
89
- Cache-Control:
90
- - max-age=0, private, must-revalidate
91
- Content-Type:
92
- - application/json
93
- Etag:
94
- - W/"838a7c62adda8d131d694ae13ba2c5b7"
95
- Server:
96
- - nginx
97
- Strict-Transport-Security:
98
- - max-age=0; includeSubDomains
99
- - max-age=31536000; includeSubDomains
100
- X-Ratelimit-Limit:
101
- - '250000'
102
- X-Ratelimit-Remaining:
103
- - '249985'
104
- X-Ratelimit-Reset:
105
- - '1574409600'
106
- X-Request-Id:
107
- - 7721b688-c1f0-423c-bb35-b967dd92bd21
108
- X-Runtime:
109
- - '0.007053'
110
- Content-Length:
111
- - '46'
112
- Accept-Ranges:
113
- - bytes
114
- Date:
115
- - Fri, 22 Nov 2019 07:59:44 GMT
116
- Via:
117
- - 1.1 varnish
118
- Connection:
119
- - keep-alive
120
- X-Served-By:
121
- - cache-hhn4067-HHN
122
- X-Cache:
123
- - MISS
124
- X-Cache-Hits:
125
- - '0'
126
- X-Timer:
127
- - S1574409584.489346,VS0,VE53
128
- Vary:
129
- - Origin,Accept-Encoding
130
- body:
131
- encoding: ASCII-8BIT
132
- string: '{"message":"success"}'
133
- http_version:
134
- recorded_at: Fri, 22 Nov 2019 07:59:44 GMT
135
- - request:
136
- method: get
137
- uri: "<BRAZE_REST_URL>/subscription/user/status?api_key=<BRAZE_REST_API_KEY>&external_id%5B%5D=test-gem-001&external_id%5B%5D=test-gem-002&external_id%5B%5D=test-gem-003"
138
- body:
139
- encoding: US-ASCII
140
- string: ''
141
- headers:
142
- Content-Type:
143
- - application/json
144
- Accept:
145
- - application/json
146
- User-Agent:
147
- - Braze Ruby gem v0.2.2
148
- Accept-Encoding:
149
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
150
- response:
151
- status:
152
- code: 200
153
- message: OK
154
- headers:
155
- Cache-Control:
156
- - max-age=0, private, must-revalidate
157
- Content-Type:
158
- - application/json
159
- Etag:
160
- - W/"c07db3553c76472c579e5181e73ec603"
161
- Server:
162
- - nginx
163
- Strict-Transport-Security:
164
- - max-age=0; includeSubDomains
165
- - max-age=31536000; includeSubDomains
166
- X-Ratelimit-Limit:
167
- - '250000'
168
- X-Ratelimit-Remaining:
169
- - '249984'
170
- X-Ratelimit-Reset:
171
- - '1574409600'
172
- X-Request-Id:
173
- - 49cde848-ee57-46f7-9692-5023fb8be287
174
- X-Runtime:
175
- - '0.024667'
176
- Accept-Ranges:
177
- - bytes
178
- - bytes
179
- Age:
180
- - '0'
181
- - '0'
182
- Content-Length:
183
- - '228'
184
- Date:
185
- - Fri, 22 Nov 2019 07:59:44 GMT
186
- Via:
187
- - 1.1 varnish
188
- Connection:
189
- - keep-alive
190
- X-Served-By:
191
- - cache-hhn4043-HHN
192
- X-Cache:
193
- - MISS
194
- X-Cache-Hits:
195
- - '0'
196
- X-Timer:
197
- - S1574409585.753149,VS0,VE28
198
- Vary:
199
- - Origin,Accept-Encoding
200
- body:
201
- encoding: ASCII-8BIT
202
- string: '{"users":[{"email":null,"phone":null,"external_id":"test-gem-001","subscription_groups":[{"id":"0201b87a-ef6e-4410-9412-a298c4c1206d","name":"Test
203
- Subscription Group","channel":"email","status":"Subscribed"}]},{"email":null,"phone":null,"external_id":"test-gem-002","subscription_groups":[{"id":"0201b87a-ef6e-4410-9412-a298c4c1206d","name":"Test
204
- Subscription Group","channel":"email","status":"Unsubscribed"}]},{"email":null,"phone":null,"external_id":"test-gem-003","subscription_groups":[]}],"total_count":3,"message":"success"}'
205
- http_version:
206
- recorded_at: Fri, 22 Nov 2019 07:59:44 GMT
207
- recorded_with: VCR 5.0.0
@@ -1,68 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: "<BRAZE_REST_URL>/users/track"
6
- body:
7
- encoding: UTF-8
8
- string: '{"api_key":"non-existent","attributes":[{"external_id":1,"foo":"bar"}],"events":[{"external_id":1,"name":"baz","time":"2019-02-15
9
- 00:00:00 -0500"}],"purchases":[{"external_id":1,"product_id":1,"time":"2019-02-15
10
- 00:00:00 -0500","currency":"CAD","price":1.0}]}'
11
- headers:
12
- User-Agent:
13
- - Faraday v0.14.0
14
- Content-Type:
15
- - application/json
16
- Accept-Encoding:
17
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
- Accept:
19
- - "*/*"
20
- response:
21
- status:
22
- code: 401
23
- message: Unauthorized
24
- headers:
25
- Cache-Control:
26
- - no-cache
27
- Content-Type:
28
- - application/json
29
- Server:
30
- - nginx
31
- Strict-Transport-Security:
32
- - max-age=0; includeSubDomains
33
- X-Ratelimit-Limit:
34
- - '0'
35
- X-Ratelimit-Remaining:
36
- - '0'
37
- X-Ratelimit-Reset:
38
- - '1524002400'
39
- X-Request-Id:
40
- - 7089825e-0390-4b95-b471-3c096e1df0e6
41
- X-Runtime:
42
- - '0.006623'
43
- Content-Length:
44
- - '85'
45
- Accept-Ranges:
46
- - bytes
47
- Date:
48
- - Tue, 17 Apr 2018 21:08:08 GMT
49
- Via:
50
- - 1.1 varnish
51
- Connection:
52
- - keep-alive
53
- X-Served-By:
54
- - cache-pdk17844-PDK
55
- X-Cache:
56
- - MISS
57
- X-Cache-Hits:
58
- - '0'
59
- X-Timer:
60
- - S1523999288.903112,VS0,VE193
61
- Vary:
62
- - Accept-Encoding
63
- body:
64
- encoding: ASCII-8BIT
65
- string: '{"message":"Invalid App Group API Identifier: non-existent"}'
66
- http_version:
67
- recorded_at: Tue, 17 Apr 2018 21:08:08 GMT
68
- recorded_with: VCR 4.0.0
@@ -1,71 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: "<BRAZE_REST_URL>/users/track"
6
- body:
7
- encoding: UTF-8
8
- string: '{"api_key":"<BRAZE_REST_API_KEY>","attributes":[{"external_id":1,"foo":"bar"}],"events":[{"external_id":1,"name":"baz","time":"2019-02-15
9
- 00:00:00 -0500"}],"purchases":[{"external_id":1,"product_id":1,"time":"2019-02-15
10
- 00:00:00 -0500","currency":"CAD","price":1.0}]}'
11
- headers:
12
- User-Agent:
13
- - Faraday v0.14.0
14
- Content-Type:
15
- - application/json
16
- Accept-Encoding:
17
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
- Accept:
19
- - "*/*"
20
- response:
21
- status:
22
- code: 201
23
- message: Created
24
- headers:
25
- Cache-Control:
26
- - max-age=0, private, must-revalidate
27
- Content-Type:
28
- - application/json
29
- Etag:
30
- - W/"68b326343749fed4d6cc5dda395b5367"
31
- Server:
32
- - nginx
33
- Strict-Transport-Security:
34
- - max-age=0; includeSubDomains
35
- - max-age=31536000; includeSubDomains
36
- X-Ratelimit-Limit:
37
- - '50000'
38
- X-Ratelimit-Remaining:
39
- - '50000'
40
- X-Ratelimit-Reset:
41
- - '1524002400'
42
- X-Request-Id:
43
- - af452a7f-9be9-417d-b9d5-2c4db3de274d
44
- X-Runtime:
45
- - '0.020310'
46
- Content-Length:
47
- - '85'
48
- Accept-Ranges:
49
- - bytes
50
- Date:
51
- - Tue, 17 Apr 2018 21:08:07 GMT
52
- Via:
53
- - 1.1 varnish
54
- Connection:
55
- - keep-alive
56
- X-Served-By:
57
- - cache-pdk17837-PDK
58
- X-Cache:
59
- - MISS
60
- X-Cache-Hits:
61
- - '0'
62
- X-Timer:
63
- - S1523999287.293178,VS0,VE220
64
- Vary:
65
- - Accept-Encoding
66
- body:
67
- encoding: ASCII-8BIT
68
- string: '{"attributes_processed":1,"events_processed":1,"purchases_processed":1,"message":"success"}'
69
- http_version:
70
- recorded_at: Tue, 17 Apr 2018 21:08:07 GMT
71
- recorded_with: VCR 4.0.0
@@ -1,71 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: "<BRAZE_REST_URL>/users/track"
6
- body:
7
- encoding: UTF-8
8
- string: '{"api_key":"<BRAZE_REST_API_KEY>","attributes":[{"external_id":1,"foo":"bar"}],"events":[{"external_id":1,"name":"baz","time":"2019-02-15
9
- 00:00:00 -0500"}],"purchases":[{"external_id":1,"product_id":1,"time":"2019-02-15
10
- 00:00:00 -0500","currency":"CAD","price":1.0}]}'
11
- headers:
12
- User-Agent:
13
- - Faraday v0.14.0
14
- Content-Type:
15
- - application/json
16
- Accept-Encoding:
17
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
- Accept:
19
- - "*/*"
20
- response:
21
- status:
22
- code: 201
23
- message: Created
24
- headers:
25
- Cache-Control:
26
- - max-age=0, private, must-revalidate
27
- Content-Type:
28
- - application/json
29
- Etag:
30
- - W/"68b326343749fed4d6cc5dda395b5367"
31
- Server:
32
- - nginx
33
- Strict-Transport-Security:
34
- - max-age=0; includeSubDomains
35
- - max-age=31536000; includeSubDomains
36
- X-Ratelimit-Limit:
37
- - '50000'
38
- X-Ratelimit-Remaining:
39
- - '50000'
40
- X-Ratelimit-Reset:
41
- - '1524002400'
42
- X-Request-Id:
43
- - e810e390-4c31-49ac-abd4-5b1151cc3c33
44
- X-Runtime:
45
- - '0.012176'
46
- Content-Length:
47
- - '85'
48
- Accept-Ranges:
49
- - bytes
50
- Date:
51
- - Tue, 17 Apr 2018 21:08:07 GMT
52
- Via:
53
- - 1.1 varnish
54
- Connection:
55
- - keep-alive
56
- X-Served-By:
57
- - cache-pdk17824-PDK
58
- X-Cache:
59
- - MISS
60
- X-Cache-Hits:
61
- - '0'
62
- X-Timer:
63
- - S1523999288.612820,VS0,VE214
64
- Vary:
65
- - Accept-Encoding
66
- body:
67
- encoding: ASCII-8BIT
68
- string: '{"attributes_processed":1,"events_processed":1,"purchases_processed":1,"message":"success"}'
69
- http_version:
70
- recorded_at: Tue, 17 Apr 2018 21:08:07 GMT
71
- recorded_with: VCR 4.0.0
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- RSpec.describe 'campaigns' do
6
- describe 'trigger_send' do
7
- it 'sends an email', vcr: true do
8
- response = api.trigger_campaign_send(
9
- campaign_id: '69e9b681-779c-4b4c-b6b8-cd74b17d21d2',
10
- recipients: [
11
- external_user_id: 132404,
12
- trigger_properties: {first_name: 'John'}
13
- ]
14
- )
15
- end
16
- end
17
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- RSpec.describe 'canvas' do
6
- describe 'trigger_send' do
7
- it 'sends a canvas', vcr: true do
8
- response = api.trigger_canvas_send(
9
- canvas_id: 'dc23ade4-e970-0c52-81bc-b369f64f533d',
10
- recipients: [
11
- external_user_id: 132404,
12
- canvas_entry_properties: {first_name: 'John'}
13
- ]
14
- )
15
- end
16
- end
17
-
18
- describe 'details' do
19
- it 'returns error when no canvas', vcr: true do
20
- response = api.canvas_details(
21
- canvas_id: 'non-existing'
22
- )
23
- expect(response.status).to eq(400)
24
- end
25
- end
26
- end