sendgrid-ruby 6.3.4 → 6.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -6
  3. data/.rubocop_todo.yml +109 -0
  4. data/.travis.yml +1 -2
  5. data/CHANGELOG.md +18 -1
  6. data/CONTRIBUTING.md +2 -5
  7. data/Makefile +1 -0
  8. data/README.md +1 -7
  9. data/Rakefile +2 -3
  10. data/USAGE.md +110 -2
  11. data/examples/accesssettings/accesssettings.rb +9 -12
  12. data/examples/alerts/alerts.rb +8 -11
  13. data/examples/apikeys/apikeys.rb +12 -15
  14. data/examples/asm/asm.rb +27 -30
  15. data/examples/browsers/browsers.rb +0 -3
  16. data/examples/campaigns/campaigns.rb +29 -32
  17. data/examples/categories/categories.rb +0 -3
  18. data/examples/clients/clients.rb +1 -4
  19. data/examples/contactdb/contactdb.rb +63 -66
  20. data/examples/devices/devices.rb +0 -3
  21. data/examples/emailactivity/emailactivity.rb +52 -0
  22. data/examples/geo/geo.rb +0 -3
  23. data/examples/helpers/eventwebhook/example.rb +4 -4
  24. data/examples/helpers/mail/example.rb +9 -10
  25. data/examples/helpers/settings/example.rb +1 -1
  26. data/examples/helpers/stats/example.rb +4 -4
  27. data/examples/ips/ips.rb +19 -22
  28. data/examples/mail/mail.rb +72 -75
  29. data/examples/mailboxproviders/mailboxproviders.rb +0 -3
  30. data/examples/mailsettings/mailsettings.rb +21 -24
  31. data/examples/partnersettings/partnersettings.rb +3 -6
  32. data/examples/scopes/scopes.rb +7 -9
  33. data/examples/senderauthentication/senderauthentication.rb +41 -44
  34. data/examples/senders/senders.rb +28 -31
  35. data/examples/stats/stats.rb +0 -3
  36. data/examples/subusers/subusers.rb +17 -20
  37. data/examples/suppression/suppression.rb +15 -18
  38. data/examples/templates/templates.rb +29 -31
  39. data/examples/trackingsettings/trackingsettings.rb +14 -17
  40. data/examples/user/user.rb +41 -44
  41. data/lib/rack/sendgrid_webhook_verification.rb +3 -2
  42. data/lib/sendgrid/base_interface.rb +1 -1
  43. data/lib/sendgrid/helpers/eventwebhook/eventwebhook.rb +4 -6
  44. data/lib/sendgrid/helpers/inbound/app.rb +1 -1
  45. data/lib/sendgrid/helpers/inbound/send.rb +2 -2
  46. data/lib/sendgrid/helpers/ip_management/ip_management.rb +1 -1
  47. data/lib/sendgrid/helpers/mail/asm.rb +6 -18
  48. data/lib/sendgrid/helpers/mail/attachment.rb +12 -42
  49. data/lib/sendgrid/helpers/mail/bcc_settings.rb +6 -18
  50. data/lib/sendgrid/helpers/mail/bypass_list_management.rb +8 -18
  51. data/lib/sendgrid/helpers/mail/category.rb +2 -2
  52. data/lib/sendgrid/helpers/mail/click_tracking.rb +6 -18
  53. data/lib/sendgrid/helpers/mail/content.rb +4 -3
  54. data/lib/sendgrid/helpers/mail/custom_arg.rb +6 -10
  55. data/lib/sendgrid/helpers/mail/email.rb +5 -4
  56. data/lib/sendgrid/helpers/mail/footer.rb +7 -27
  57. data/lib/sendgrid/helpers/mail/ganalytics.rb +10 -54
  58. data/lib/sendgrid/helpers/mail/header.rb +6 -10
  59. data/lib/sendgrid/helpers/mail/mail.rb +30 -48
  60. data/lib/sendgrid/helpers/mail/mail_settings.rb +9 -25
  61. data/lib/sendgrid/helpers/mail/open_tracking.rb +6 -18
  62. data/lib/sendgrid/helpers/mail/personalization.rb +34 -27
  63. data/lib/sendgrid/helpers/mail/section.rb +6 -10
  64. data/lib/sendgrid/helpers/mail/spam_check.rb +7 -27
  65. data/lib/sendgrid/helpers/mail/subscription_tracking.rb +8 -36
  66. data/lib/sendgrid/helpers/mail/substitution.rb +6 -10
  67. data/lib/sendgrid/helpers/mail/tracking_settings.rb +7 -20
  68. data/lib/sendgrid/helpers/permissions/scope.rb +1 -1
  69. data/lib/sendgrid/helpers/settings/settings.rb +1 -1
  70. data/lib/sendgrid/helpers/settings/tracking_settings_dto.rb +3 -5
  71. data/lib/sendgrid/helpers/stats/metrics.rb +5 -5
  72. data/lib/sendgrid/sendgrid.rb +1 -1
  73. data/lib/sendgrid/twilio_email.rb +1 -1
  74. data/lib/sendgrid/version.rb +1 -1
  75. data/mail_helper_v3.md +3 -3
  76. data/sendgrid-ruby.gemspec +7 -8
  77. data/spec/fixtures/event_webhook.rb +17 -11
  78. data/spec/rack/sendgrid_webhook_verification_spec.rb +4 -4
  79. data/spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb +38 -36
  80. data/spec/sendgrid/helpers/settings/mail_settings_dto_spec.rb +1 -1
  81. data/spec/sendgrid/helpers/settings/partner_settings_dto_spec.rb +1 -1
  82. data/spec/sendgrid/helpers/settings/settings_spec.rb +2 -2
  83. data/spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb +1 -1
  84. data/spec/sendgrid/helpers/settings/user_settings_dto_spec.rb +1 -1
  85. data/spec/sendgrid/helpers/stats/email_stats_spec.rb +22 -23
  86. data/spec/sendgrid/helpers/stats/metrics_spec.rb +19 -20
  87. data/spec/sendgrid/helpers/stats/stats_response_spec.rb +22 -23
  88. data/spec/spec_helper.rb +1 -1
  89. data/test/sendgrid/helpers/mail/test_attachment.rb +4 -6
  90. data/test/sendgrid/helpers/mail/test_category.rb +0 -2
  91. data/test/sendgrid/helpers/mail/test_email.rb +9 -11
  92. data/test/sendgrid/helpers/mail/test_mail.rb +101 -102
  93. data/test/sendgrid/helpers/mail/test_personalizations.rb +106 -93
  94. data/test/sendgrid/permissions/test_scopes.rb +0 -2
  95. data/test/sendgrid/test_sendgrid-ruby.rb +1946 -1947
  96. data/use-cases/legacy-templates.md +1 -1
  97. data/use-cases/transactional-templates.md +1 -1
  98. metadata +38 -36
@@ -2,7 +2,6 @@ require_relative '../../../lib/sendgrid/helpers/permissions/scope'
2
2
  require 'minitest/autorun'
3
3
 
4
4
  class TestCategory < Minitest::Test
5
-
6
5
  include SendGrid
7
6
 
8
7
  # usecases
@@ -34,5 +33,4 @@ class TestCategory < Minitest::Test
34
33
  assert_equal Scope.send("#{endpoint}_full_access_permissions"), @scopes_from_yaml[endpoint].values.flatten
35
34
  end
36
35
  end
37
-
38
36
  end
@@ -6,1137 +6,1183 @@ require 'minitest/autorun'
6
6
  require 'minitest/unit'
7
7
 
8
8
  class TestAPI < MiniTest::Test
9
+ def setup
10
+ @sg = SendGrid::API.new(api_key: 'SENDGRID_API_KEY')
11
+ end
12
+
13
+ def test_init
14
+ headers = JSON.parse('
15
+ {
16
+ "X-Test": "test"
17
+ }
18
+ ')
19
+ subuser = 'test_user'
20
+ sg = SendGrid::API.new(api_key: 'SENDGRID_API_KEY', host: 'https://api.test.com', request_headers: headers, version: 'v3', impersonate_subuser: subuser)
21
+
22
+ assert_equal('https://api.test.com', sg.host)
23
+ user_agent = "sendgrid/#{SendGrid::VERSION};ruby"
24
+ test_headers = JSON.parse('
25
+ {
26
+ "Authorization": "Bearer SENDGRID_API_KEY",
27
+ "Accept": "application/json",
28
+ "X-Test": "test",
29
+ "User-Agent": "' + user_agent + '",
30
+ "On-Behalf-Of": "' + subuser + '"
31
+ }
32
+ ')
33
+ assert_equal(test_headers, sg.request_headers)
34
+ assert_equal('v3', sg.version)
35
+ assert_equal(subuser, sg.impersonate_subuser)
36
+ assert_equal('6.3.5', SendGrid::VERSION)
37
+ assert_instance_of(SendGrid::Client, sg.client)
38
+ end
39
+
40
+ def test_init_when_impersonate_subuser_is_not_given
41
+ sg = SendGrid::API.new(api_key: 'SENDGRID_API_KEY', host: 'https://api.test.com', version: 'v3')
42
+ refute_includes(sg.request_headers, 'On-Behalf-Of')
43
+ end
44
+
45
+ def test_access_settings_activity_get
46
+ params = JSON.parse('{"limit": 1}')
47
+ headers = JSON.parse('{"X-Mock": 200}')
9
48
 
10
- def setup
11
- @sg = SendGrid::API.new(api_key: "SENDGRID_API_KEY")
12
- end
13
-
14
- def test_init
15
- headers = JSON.parse('
16
- {
17
- "X-Test": "test"
18
- }
19
- ')
20
- subuser = 'test_user'
21
- sg = SendGrid::API.new(api_key: "SENDGRID_API_KEY", host: "https://api.test.com", request_headers: headers, version: "v3", impersonate_subuser: subuser)
22
-
23
- assert_equal("https://api.test.com", sg.host)
24
- user_agent = "sendgrid/#{SendGrid::VERSION};ruby"
25
- test_headers = JSON.parse('
26
- {
27
- "Authorization": "Bearer SENDGRID_API_KEY",
28
- "Accept": "application/json",
29
- "X-Test": "test",
30
- "User-Agent": "' + user_agent + '",
31
- "On-Behalf-Of": "' + subuser + '"
32
- }
33
- ')
34
- assert_equal(test_headers, sg.request_headers)
35
- assert_equal("v3", sg.version)
36
- assert_equal(subuser, sg.impersonate_subuser)
37
- assert_equal("6.3.4", SendGrid::VERSION)
38
- assert_instance_of(SendGrid::Client, sg.client)
39
- end
40
-
41
- def test_init_when_impersonate_subuser_is_not_given
42
- sg = SendGrid::API.new(api_key: "SENDGRID_API_KEY", host: "https://api.test.com", version: "v3")
43
- refute_includes(sg.request_headers, 'On-Behalf-Of')
44
- end
45
-
46
- def test_access_settings_activity_get
47
- params = JSON.parse('{"limit": 1}')
48
- headers = JSON.parse('{"X-Mock": 200}')
49
-
50
- response = @sg.client.access_settings.activity.get(query_params: params, request_headers: headers)
51
-
52
- self.assert_equal('200', response.status_code)
53
- end
54
-
55
- def test_access_settings_whitelist_post
56
- data = JSON.parse('{
57
- "ips": [
58
- {
59
- "ip": "192.168.1.1"
60
- },
61
- {
62
- "ip": "192.*.*.*"
63
- },
64
- {
65
- "ip": "192.168.1.3/32"
66
- }
67
- ]
49
+ response = @sg.client.access_settings.activity.get(query_params: params, request_headers: headers)
50
+
51
+ assert_equal('200', response.status_code)
52
+ end
53
+
54
+ def test_access_settings_whitelist_post
55
+ data = JSON.parse('{
56
+ "ips": [
57
+ {
58
+ "ip": "192.168.1.1"
59
+ },
60
+ {
61
+ "ip": "192.*.*.*"
62
+ },
63
+ {
64
+ "ip": "192.168.1.3/32"
65
+ }
66
+ ]
68
67
  }')
69
- headers = JSON.parse('{"X-Mock": 201}')
68
+ headers = JSON.parse('{"X-Mock": 201}')
70
69
 
71
- response = @sg.client.access_settings.whitelist.post(request_body: data, request_headers: headers)
70
+ response = @sg.client.access_settings.whitelist.post(request_body: data, request_headers: headers)
72
71
 
73
- self.assert_equal('201', response.status_code)
74
- end
72
+ assert_equal('201', response.status_code)
73
+ end
75
74
 
76
- def test_access_settings_whitelist_get
77
- headers = JSON.parse('{"X-Mock": 200}')
75
+ def test_access_settings_whitelist_get
76
+ headers = JSON.parse('{"X-Mock": 200}')
78
77
 
79
- response = @sg.client.access_settings.whitelist.get(request_headers: headers)
78
+ response = @sg.client.access_settings.whitelist.get(request_headers: headers)
80
79
 
81
- self.assert_equal('200', response.status_code)
82
- end
80
+ assert_equal('200', response.status_code)
81
+ end
83
82
 
84
- def test_access_settings_whitelist_delete
85
- data = JSON.parse('{
86
- "ids": [
87
- 1,
88
- 2,
89
- 3
90
- ]
83
+ def test_access_settings_whitelist_delete
84
+ data = JSON.parse('{
85
+ "ids": [
86
+ 1,
87
+ 2,
88
+ 3
89
+ ]
91
90
  }')
92
- headers = JSON.parse('{"X-Mock": 204}')
91
+ headers = JSON.parse('{"X-Mock": 204}')
93
92
 
94
- response = @sg.client.access_settings.whitelist.delete(request_body: data, request_headers: headers)
93
+ response = @sg.client.access_settings.whitelist.delete(request_body: data, request_headers: headers)
95
94
 
96
- self.assert_equal('204', response.status_code)
97
- end
95
+ assert_equal('204', response.status_code)
96
+ end
98
97
 
99
- def test_access_settings_whitelist__rule_id__get
100
- rule_id = "test_url_param"
101
- headers = JSON.parse('{"X-Mock": 200}')
98
+ def test_access_settings_whitelist__rule_id__get
99
+ rule_id = 'test_url_param'
100
+ headers = JSON.parse('{"X-Mock": 200}')
102
101
 
103
- response = @sg.client.access_settings.whitelist._(rule_id).get(request_headers: headers)
102
+ response = @sg.client.access_settings.whitelist._(rule_id).get(request_headers: headers)
104
103
 
105
- self.assert_equal('200', response.status_code)
106
- end
104
+ assert_equal('200', response.status_code)
105
+ end
107
106
 
108
- def test_access_settings_whitelist__rule_id__delete
109
- rule_id = "test_url_param"
110
- headers = JSON.parse('{"X-Mock": 204}')
107
+ def test_access_settings_whitelist__rule_id__delete
108
+ rule_id = 'test_url_param'
109
+ headers = JSON.parse('{"X-Mock": 204}')
111
110
 
112
- response = @sg.client.access_settings.whitelist._(rule_id).delete(request_headers: headers)
111
+ response = @sg.client.access_settings.whitelist._(rule_id).delete(request_headers: headers)
113
112
 
114
- self.assert_equal('204', response.status_code)
115
- end
113
+ assert_equal('204', response.status_code)
114
+ end
116
115
 
117
- def test_alerts_post
118
- data = JSON.parse('{
119
- "email_to": "example@example.com",
120
- "frequency": "daily",
121
- "type": "stats_notification"
116
+ def test_alerts_post
117
+ data = JSON.parse('{
118
+ "email_to": "example@example.com",
119
+ "frequency": "daily",
120
+ "type": "stats_notification"
122
121
  }')
123
- headers = JSON.parse('{"X-Mock": 201}')
122
+ headers = JSON.parse('{"X-Mock": 201}')
124
123
 
125
- response = @sg.client.alerts.post(request_body: data, request_headers: headers)
124
+ response = @sg.client.alerts.post(request_body: data, request_headers: headers)
126
125
 
127
- self.assert_equal('201', response.status_code)
128
- end
126
+ assert_equal('201', response.status_code)
127
+ end
129
128
 
130
- def test_alerts_get
131
- headers = JSON.parse('{"X-Mock": 200}')
129
+ def test_alerts_get
130
+ headers = JSON.parse('{"X-Mock": 200}')
132
131
 
133
- response = @sg.client.alerts.get(request_headers: headers)
132
+ response = @sg.client.alerts.get(request_headers: headers)
134
133
 
135
- self.assert_equal('200', response.status_code)
136
- end
134
+ assert_equal('200', response.status_code)
135
+ end
137
136
 
138
- def test_alerts__alert_id__patch
139
- data = JSON.parse('{
140
- "email_to": "example@example.com"
137
+ def test_alerts__alert_id__patch
138
+ data = JSON.parse('{
139
+ "email_to": "example@example.com"
141
140
  }')
142
- alert_id = "test_url_param"
143
- headers = JSON.parse('{"X-Mock": 200}')
141
+ alert_id = 'test_url_param'
142
+ headers = JSON.parse('{"X-Mock": 200}')
144
143
 
145
- response = @sg.client.alerts._(alert_id).patch(request_body: data, request_headers: headers)
144
+ response = @sg.client.alerts._(alert_id).patch(request_body: data, request_headers: headers)
146
145
 
147
- self.assert_equal('200', response.status_code)
148
- end
146
+ assert_equal('200', response.status_code)
147
+ end
149
148
 
150
- def test_alerts__alert_id__get
151
- alert_id = "test_url_param"
152
- headers = JSON.parse('{"X-Mock": 200}')
149
+ def test_alerts__alert_id__get
150
+ alert_id = 'test_url_param'
151
+ headers = JSON.parse('{"X-Mock": 200}')
153
152
 
154
- response = @sg.client.alerts._(alert_id).get(request_headers: headers)
153
+ response = @sg.client.alerts._(alert_id).get(request_headers: headers)
155
154
 
156
- self.assert_equal('200', response.status_code)
157
- end
155
+ assert_equal('200', response.status_code)
156
+ end
158
157
 
159
- def test_alerts__alert_id__delete
160
- alert_id = "test_url_param"
161
- headers = JSON.parse('{"X-Mock": 204}')
158
+ def test_alerts__alert_id__delete
159
+ alert_id = 'test_url_param'
160
+ headers = JSON.parse('{"X-Mock": 204}')
162
161
 
163
- response = @sg.client.alerts._(alert_id).delete(request_headers: headers)
162
+ response = @sg.client.alerts._(alert_id).delete(request_headers: headers)
164
163
 
165
- self.assert_equal('204', response.status_code)
166
- end
164
+ assert_equal('204', response.status_code)
165
+ end
167
166
 
168
- def test_api_keys_post
169
- data = JSON.parse('{
170
- "name": "My API Key",
171
- "sample": "data",
172
- "scopes": [
173
- "mail.send",
174
- "alerts.create",
175
- "alerts.read"
176
- ]
167
+ def test_api_keys_post
168
+ data = JSON.parse('{
169
+ "name": "My API Key",
170
+ "sample": "data",
171
+ "scopes": [
172
+ "mail.send",
173
+ "alerts.create",
174
+ "alerts.read"
175
+ ]
177
176
  }')
178
- headers = JSON.parse('{"X-Mock": 201}')
177
+ headers = JSON.parse('{"X-Mock": 201}')
179
178
 
180
- response = @sg.client.api_keys.post(request_body: data, request_headers: headers)
179
+ response = @sg.client.api_keys.post(request_body: data, request_headers: headers)
181
180
 
182
- self.assert_equal('201', response.status_code)
183
- end
181
+ assert_equal('201', response.status_code)
182
+ end
184
183
 
185
- def test_api_keys_get
186
- params = JSON.parse('{"limit": 1}')
187
- headers = JSON.parse('{"X-Mock": 200}')
184
+ def test_api_keys_get
185
+ params = JSON.parse('{"limit": 1}')
186
+ headers = JSON.parse('{"X-Mock": 200}')
188
187
 
189
- response = @sg.client.api_keys.get(query_params: params, request_headers: headers)
188
+ response = @sg.client.api_keys.get(query_params: params, request_headers: headers)
190
189
 
191
- self.assert_equal('200', response.status_code)
192
- end
190
+ assert_equal('200', response.status_code)
191
+ end
193
192
 
194
- def test_api_keys__api_key_id__put
195
- data = JSON.parse('{
196
- "name": "A New Hope",
197
- "scopes": [
198
- "user.profile.read",
199
- "user.profile.update"
200
- ]
193
+ def test_api_keys__api_key_id__put
194
+ data = JSON.parse('{
195
+ "name": "A New Hope",
196
+ "scopes": [
197
+ "user.profile.read",
198
+ "user.profile.update"
199
+ ]
201
200
  }')
202
- api_key_id = "test_url_param"
203
- headers = JSON.parse('{"X-Mock": 200}')
201
+ api_key_id = 'test_url_param'
202
+ headers = JSON.parse('{"X-Mock": 200}')
204
203
 
205
- response = @sg.client.api_keys._(api_key_id).put(request_body: data, request_headers: headers)
204
+ response = @sg.client.api_keys._(api_key_id).put(request_body: data, request_headers: headers)
206
205
 
207
- self.assert_equal('200', response.status_code)
208
- end
206
+ assert_equal('200', response.status_code)
207
+ end
209
208
 
210
- def test_api_keys__api_key_id__patch
211
- data = JSON.parse('{
212
- "name": "A New Hope"
209
+ def test_api_keys__api_key_id__patch
210
+ data = JSON.parse('{
211
+ "name": "A New Hope"
213
212
  }')
214
- api_key_id = "test_url_param"
215
- headers = JSON.parse('{"X-Mock": 200}')
213
+ api_key_id = 'test_url_param'
214
+ headers = JSON.parse('{"X-Mock": 200}')
216
215
 
217
- response = @sg.client.api_keys._(api_key_id).patch(request_body: data, request_headers: headers)
216
+ response = @sg.client.api_keys._(api_key_id).patch(request_body: data, request_headers: headers)
218
217
 
219
- self.assert_equal('200', response.status_code)
220
- end
218
+ assert_equal('200', response.status_code)
219
+ end
221
220
 
222
- def test_api_keys__api_key_id__get
223
- api_key_id = "test_url_param"
224
- headers = JSON.parse('{"X-Mock": 200}')
221
+ def test_api_keys__api_key_id__get
222
+ api_key_id = 'test_url_param'
223
+ headers = JSON.parse('{"X-Mock": 200}')
225
224
 
226
- response = @sg.client.api_keys._(api_key_id).get(request_headers: headers)
225
+ response = @sg.client.api_keys._(api_key_id).get(request_headers: headers)
227
226
 
228
- self.assert_equal('200', response.status_code)
229
- end
227
+ assert_equal('200', response.status_code)
228
+ end
230
229
 
231
- def test_api_keys__api_key_id__delete
232
- api_key_id = "test_url_param"
233
- headers = JSON.parse('{"X-Mock": 204}')
230
+ def test_api_keys__api_key_id__delete
231
+ api_key_id = 'test_url_param'
232
+ headers = JSON.parse('{"X-Mock": 204}')
234
233
 
235
- response = @sg.client.api_keys._(api_key_id).delete(request_headers: headers)
234
+ response = @sg.client.api_keys._(api_key_id).delete(request_headers: headers)
236
235
 
237
- self.assert_equal('204', response.status_code)
238
- end
236
+ assert_equal('204', response.status_code)
237
+ end
239
238
 
240
- def test_asm_groups_post
241
- data = JSON.parse('{
242
- "description": "Suggestions for products our users might like.",
243
- "is_default": true,
244
- "name": "Product Suggestions"
239
+ def test_asm_groups_post
240
+ data = JSON.parse('{
241
+ "description": "Suggestions for products our users might like.",
242
+ "is_default": true,
243
+ "name": "Product Suggestions"
245
244
  }')
246
- headers = JSON.parse('{"X-Mock": 201}')
245
+ headers = JSON.parse('{"X-Mock": 201}')
247
246
 
248
- response = @sg.client.asm.groups.post(request_body: data, request_headers: headers)
247
+ response = @sg.client.asm.groups.post(request_body: data, request_headers: headers)
249
248
 
250
- self.assert_equal('201', response.status_code)
251
- end
249
+ assert_equal('201', response.status_code)
250
+ end
252
251
 
253
- def test_asm_groups_get
254
- params = JSON.parse('{"id": 1}')
255
- headers = JSON.parse('{"X-Mock": 200}')
252
+ def test_asm_groups_get
253
+ params = JSON.parse('{"id": 1}')
254
+ headers = JSON.parse('{"X-Mock": 200}')
256
255
 
257
- response = @sg.client.asm.groups.get(query_params: params, request_headers: headers)
256
+ response = @sg.client.asm.groups.get(query_params: params, request_headers: headers)
258
257
 
259
- self.assert_equal('200', response.status_code)
260
- end
258
+ assert_equal('200', response.status_code)
259
+ end
261
260
 
262
- def test_asm_groups__group_id__patch
263
- data = JSON.parse('{
264
- "description": "Suggestions for items our users might like.",
265
- "id": 103,
266
- "name": "Item Suggestions"
261
+ def test_asm_groups__group_id__patch
262
+ data = JSON.parse('{
263
+ "description": "Suggestions for items our users might like.",
264
+ "id": 103,
265
+ "name": "Item Suggestions"
267
266
  }')
268
- group_id = "test_url_param"
269
- headers = JSON.parse('{"X-Mock": 201}')
267
+ group_id = 'test_url_param'
268
+ headers = JSON.parse('{"X-Mock": 201}')
270
269
 
271
- response = @sg.client.asm.groups._(group_id).patch(request_body: data, request_headers: headers)
270
+ response = @sg.client.asm.groups._(group_id).patch(request_body: data, request_headers: headers)
272
271
 
273
- self.assert_equal('201', response.status_code)
274
- end
272
+ assert_equal('201', response.status_code)
273
+ end
275
274
 
276
- def test_asm_groups__group_id__get
277
- group_id = "test_url_param"
278
- headers = JSON.parse('{"X-Mock": 200}')
275
+ def test_asm_groups__group_id__get
276
+ group_id = 'test_url_param'
277
+ headers = JSON.parse('{"X-Mock": 200}')
279
278
 
280
- response = @sg.client.asm.groups._(group_id).get(request_headers: headers)
279
+ response = @sg.client.asm.groups._(group_id).get(request_headers: headers)
281
280
 
282
- self.assert_equal('200', response.status_code)
283
- end
281
+ assert_equal('200', response.status_code)
282
+ end
284
283
 
285
- def test_asm_groups__group_id__delete
286
- group_id = "test_url_param"
287
- headers = JSON.parse('{"X-Mock": 204}')
284
+ def test_asm_groups__group_id__delete
285
+ group_id = 'test_url_param'
286
+ headers = JSON.parse('{"X-Mock": 204}')
288
287
 
289
- response = @sg.client.asm.groups._(group_id).delete(request_headers: headers)
288
+ response = @sg.client.asm.groups._(group_id).delete(request_headers: headers)
290
289
 
291
- self.assert_equal('204', response.status_code)
292
- end
290
+ assert_equal('204', response.status_code)
291
+ end
293
292
 
294
- def test_asm_groups__group_id__suppressions_post
295
- data = JSON.parse('{
296
- "recipient_emails": [
297
- "test1@example.com",
298
- "test2@example.com"
299
- ]
293
+ def test_asm_groups__group_id__suppressions_post
294
+ data = JSON.parse('{
295
+ "recipient_emails": [
296
+ "test1@example.com",
297
+ "test2@example.com"
298
+ ]
300
299
  }')
301
- group_id = "test_url_param"
302
- headers = JSON.parse('{"X-Mock": 201}')
300
+ group_id = 'test_url_param'
301
+ headers = JSON.parse('{"X-Mock": 201}')
303
302
 
304
- response = @sg.client.asm.groups._(group_id).suppressions.post(request_body: data, request_headers: headers)
303
+ response = @sg.client.asm.groups._(group_id).suppressions.post(request_body: data, request_headers: headers)
305
304
 
306
- self.assert_equal('201', response.status_code)
307
- end
305
+ assert_equal('201', response.status_code)
306
+ end
308
307
 
309
- def test_asm_groups__group_id__suppressions_get
310
- group_id = "test_url_param"
311
- headers = JSON.parse('{"X-Mock": 200}')
308
+ def test_asm_groups__group_id__suppressions_get
309
+ group_id = 'test_url_param'
310
+ headers = JSON.parse('{"X-Mock": 200}')
312
311
 
313
- response = @sg.client.asm.groups._(group_id).suppressions.get(request_headers: headers)
312
+ response = @sg.client.asm.groups._(group_id).suppressions.get(request_headers: headers)
314
313
 
315
- self.assert_equal('200', response.status_code)
316
- end
314
+ assert_equal('200', response.status_code)
315
+ end
317
316
 
318
- def test_asm_groups__group_id__suppressions_search_post
319
- data = JSON.parse('{
320
- "recipient_emails": [
321
- "exists1@example.com",
322
- "exists2@example.com",
323
- "doesnotexists@example.com"
324
- ]
317
+ def test_asm_groups__group_id__suppressions_search_post
318
+ data = JSON.parse('{
319
+ "recipient_emails": [
320
+ "exists1@example.com",
321
+ "exists2@example.com",
322
+ "doesnotexists@example.com"
323
+ ]
325
324
  }')
326
- group_id = "test_url_param"
327
- headers = JSON.parse('{"X-Mock": 200}')
325
+ group_id = 'test_url_param'
326
+ headers = JSON.parse('{"X-Mock": 200}')
328
327
 
329
- response = @sg.client.asm.groups._(group_id).suppressions.search.post(request_body: data, request_headers: headers)
328
+ response = @sg.client.asm.groups._(group_id).suppressions.search.post(request_body: data, request_headers: headers)
330
329
 
331
- self.assert_equal('200', response.status_code)
332
- end
330
+ assert_equal('200', response.status_code)
331
+ end
333
332
 
334
- def test_asm_groups__group_id__suppressions__email__delete
335
- group_id = "test_url_param"
336
- email = "test_url_param"
337
- headers = JSON.parse('{"X-Mock": 204}')
333
+ def test_asm_groups__group_id__suppressions__email__delete
334
+ group_id = 'test_url_param'
335
+ email = 'test_url_param'
336
+ headers = JSON.parse('{"X-Mock": 204}')
338
337
 
339
- response = @sg.client.asm.groups._(group_id).suppressions._(email).delete(request_headers: headers)
338
+ response = @sg.client.asm.groups._(group_id).suppressions._(email).delete(request_headers: headers)
340
339
 
341
- self.assert_equal('204', response.status_code)
342
- end
340
+ assert_equal('204', response.status_code)
341
+ end
343
342
 
344
- def test_asm_suppressions_get
345
- headers = JSON.parse('{"X-Mock": 200}')
343
+ def test_asm_suppressions_get
344
+ headers = JSON.parse('{"X-Mock": 200}')
346
345
 
347
- response = @sg.client.asm.suppressions.get(request_headers: headers)
346
+ response = @sg.client.asm.suppressions.get(request_headers: headers)
348
347
 
349
- self.assert_equal('200', response.status_code)
350
- end
348
+ assert_equal('200', response.status_code)
349
+ end
351
350
 
352
- def test_asm_suppressions_global_post
353
- data = JSON.parse('{
354
- "recipient_emails": [
355
- "test1@example.com",
356
- "test2@example.com"
357
- ]
351
+ def test_asm_suppressions_global_post
352
+ data = JSON.parse('{
353
+ "recipient_emails": [
354
+ "test1@example.com",
355
+ "test2@example.com"
356
+ ]
358
357
  }')
359
- headers = JSON.parse('{"X-Mock": 201}')
358
+ headers = JSON.parse('{"X-Mock": 201}')
360
359
 
361
- response = @sg.client.asm.suppressions.global.post(request_body: data, request_headers: headers)
360
+ response = @sg.client.asm.suppressions.global.post(request_body: data, request_headers: headers)
362
361
 
363
- self.assert_equal('201', response.status_code)
364
- end
362
+ assert_equal('201', response.status_code)
363
+ end
365
364
 
366
- def test_asm_suppressions_global__email__get
367
- email = "test_url_param"
368
- headers = JSON.parse('{"X-Mock": 200}')
365
+ def test_asm_suppressions_global__email__get
366
+ email = 'test_url_param'
367
+ headers = JSON.parse('{"X-Mock": 200}')
369
368
 
370
- response = @sg.client.asm.suppressions.global._(email).get(request_headers: headers)
369
+ response = @sg.client.asm.suppressions.global._(email).get(request_headers: headers)
371
370
 
372
- self.assert_equal('200', response.status_code)
373
- end
371
+ assert_equal('200', response.status_code)
372
+ end
374
373
 
375
- def test_asm_suppressions_global__email__delete
376
- email = "test_url_param"
377
- headers = JSON.parse('{"X-Mock": 204}')
374
+ def test_asm_suppressions_global__email__delete
375
+ email = 'test_url_param'
376
+ headers = JSON.parse('{"X-Mock": 204}')
378
377
 
379
- response = @sg.client.asm.suppressions.global._(email).delete(request_headers: headers)
378
+ response = @sg.client.asm.suppressions.global._(email).delete(request_headers: headers)
380
379
 
381
- self.assert_equal('204', response.status_code)
382
- end
380
+ assert_equal('204', response.status_code)
381
+ end
383
382
 
384
- def test_asm_suppressions__email__get
385
- email = "test_url_param"
386
- headers = JSON.parse('{"X-Mock": 200}')
383
+ def test_asm_suppressions__email__get
384
+ email = 'test_url_param'
385
+ headers = JSON.parse('{"X-Mock": 200}')
387
386
 
388
- response = @sg.client.asm.suppressions._(email).get(request_headers: headers)
387
+ response = @sg.client.asm.suppressions._(email).get(request_headers: headers)
389
388
 
390
- self.assert_equal('200', response.status_code)
391
- end
389
+ assert_equal('200', response.status_code)
390
+ end
392
391
 
393
- def test_browsers_stats_get
394
- params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "browsers": "test_string", "limit": "test_string", "offset": "test_string", "start_date": "2016-01-01"}')
395
- headers = JSON.parse('{"X-Mock": 200}')
392
+ def test_browsers_stats_get
393
+ params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "browsers": "test_string", "limit": "test_string", "offset": "test_string", "start_date": "2016-01-01"}')
394
+ headers = JSON.parse('{"X-Mock": 200}')
396
395
 
397
- response = @sg.client.browsers.stats.get(query_params: params, request_headers: headers)
396
+ response = @sg.client.browsers.stats.get(query_params: params, request_headers: headers)
398
397
 
399
- self.assert_equal('200', response.status_code)
400
- end
398
+ assert_equal('200', response.status_code)
399
+ end
401
400
 
402
- def test_campaigns_post
403
- data = JSON.parse('{
404
- "categories": [
405
- "spring line"
406
- ],
407
- "custom_unsubscribe_url": "",
408
- "html_content": "<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>",
409
- "ip_pool": "marketing",
410
- "list_ids": [
411
- 110,
412
- 124
413
- ],
414
- "plain_content": "Check out our spring line!",
415
- "segment_ids": [
416
- 110
417
- ],
418
- "sender_id": 124451,
419
- "subject": "New Products for Spring!",
420
- "suppression_group_id": 42,
421
- "title": "March Newsletter"
401
+ def test_campaigns_post
402
+ data = JSON.parse('{
403
+ "categories": [
404
+ "spring line"
405
+ ],
406
+ "custom_unsubscribe_url": "",
407
+ "html_content": "<html><head><title></title></head><body><p>Check out our spring line!</p></body></html>",
408
+ "ip_pool": "marketing",
409
+ "list_ids": [
410
+ 110,
411
+ 124
412
+ ],
413
+ "plain_content": "Check out our spring line!",
414
+ "segment_ids": [
415
+ 110
416
+ ],
417
+ "sender_id": 124451,
418
+ "subject": "New Products for Spring!",
419
+ "suppression_group_id": 42,
420
+ "title": "March Newsletter"
422
421
  }')
423
- headers = JSON.parse('{"X-Mock": 201}')
422
+ headers = JSON.parse('{"X-Mock": 201}')
424
423
 
425
- response = @sg.client.campaigns.post(request_body: data, request_headers: headers)
424
+ response = @sg.client.campaigns.post(request_body: data, request_headers: headers)
426
425
 
427
- self.assert_equal('201', response.status_code)
428
- end
426
+ assert_equal('201', response.status_code)
427
+ end
429
428
 
430
- def test_campaigns_get
431
- params = JSON.parse('{"limit": 1, "offset": 1}')
432
- headers = JSON.parse('{"X-Mock": 200}')
429
+ def test_campaigns_get
430
+ params = JSON.parse('{"limit": 1, "offset": 1}')
431
+ headers = JSON.parse('{"X-Mock": 200}')
433
432
 
434
- response = @sg.client.campaigns.get(query_params: params, request_headers: headers)
433
+ response = @sg.client.campaigns.get(query_params: params, request_headers: headers)
435
434
 
436
- self.assert_equal('200', response.status_code)
437
- end
435
+ assert_equal('200', response.status_code)
436
+ end
438
437
 
439
- def test_campaigns__campaign_id__patch
440
- data = JSON.parse('{
441
- "categories": [
442
- "summer line"
443
- ],
444
- "html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>",
445
- "plain_content": "Check out our summer line!",
446
- "subject": "New Products for Summer!",
447
- "title": "May Newsletter"
438
+ def test_campaigns__campaign_id__patch
439
+ data = JSON.parse('{
440
+ "categories": [
441
+ "summer line"
442
+ ],
443
+ "html_content": "<html><head><title></title></head><body><p>Check out our summer line!</p></body></html>",
444
+ "plain_content": "Check out our summer line!",
445
+ "subject": "New Products for Summer!",
446
+ "title": "May Newsletter"
448
447
  }')
449
- campaign_id = "test_url_param"
450
- headers = JSON.parse('{"X-Mock": 200}')
448
+ campaign_id = 'test_url_param'
449
+ headers = JSON.parse('{"X-Mock": 200}')
451
450
 
452
- response = @sg.client.campaigns._(campaign_id).patch(request_body: data, request_headers: headers)
451
+ response = @sg.client.campaigns._(campaign_id).patch(request_body: data, request_headers: headers)
453
452
 
454
- self.assert_equal('200', response.status_code)
455
- end
453
+ assert_equal('200', response.status_code)
454
+ end
456
455
 
457
- def test_campaigns__campaign_id__get
458
- campaign_id = "test_url_param"
459
- headers = JSON.parse('{"X-Mock": 200}')
456
+ def test_campaigns__campaign_id__get
457
+ campaign_id = 'test_url_param'
458
+ headers = JSON.parse('{"X-Mock": 200}')
460
459
 
461
- response = @sg.client.campaigns._(campaign_id).get(request_headers: headers)
460
+ response = @sg.client.campaigns._(campaign_id).get(request_headers: headers)
462
461
 
463
- self.assert_equal('200', response.status_code)
464
- end
462
+ assert_equal('200', response.status_code)
463
+ end
465
464
 
466
- def test_campaigns__campaign_id__delete
467
- campaign_id = "test_url_param"
468
- headers = JSON.parse('{"X-Mock": 204}')
465
+ def test_campaigns__campaign_id__delete
466
+ campaign_id = 'test_url_param'
467
+ headers = JSON.parse('{"X-Mock": 204}')
469
468
 
470
- response = @sg.client.campaigns._(campaign_id).delete(request_headers: headers)
469
+ response = @sg.client.campaigns._(campaign_id).delete(request_headers: headers)
471
470
 
472
- self.assert_equal('204', response.status_code)
473
- end
471
+ assert_equal('204', response.status_code)
472
+ end
474
473
 
475
- def test_campaigns__campaign_id__schedules_patch
476
- data = JSON.parse('{
477
- "send_at": 1489451436
474
+ def test_campaigns__campaign_id__schedules_patch
475
+ data = JSON.parse('{
476
+ "send_at": 1489451436
478
477
  }')
479
- campaign_id = "test_url_param"
480
- headers = JSON.parse('{"X-Mock": 200}')
478
+ campaign_id = 'test_url_param'
479
+ headers = JSON.parse('{"X-Mock": 200}')
481
480
 
482
- response = @sg.client.campaigns._(campaign_id).schedules.patch(request_body: data, request_headers: headers)
481
+ response = @sg.client.campaigns._(campaign_id).schedules.patch(request_body: data, request_headers: headers)
483
482
 
484
- self.assert_equal('200', response.status_code)
485
- end
483
+ assert_equal('200', response.status_code)
484
+ end
486
485
 
487
- def test_campaigns__campaign_id__schedules_post
488
- data = JSON.parse('{
489
- "send_at": 1489771528
486
+ def test_campaigns__campaign_id__schedules_post
487
+ data = JSON.parse('{
488
+ "send_at": 1489771528
490
489
  }')
491
- campaign_id = "test_url_param"
492
- headers = JSON.parse('{"X-Mock": 201}')
490
+ campaign_id = 'test_url_param'
491
+ headers = JSON.parse('{"X-Mock": 201}')
493
492
 
494
- response = @sg.client.campaigns._(campaign_id).schedules.post(request_body: data, request_headers: headers)
493
+ response = @sg.client.campaigns._(campaign_id).schedules.post(request_body: data, request_headers: headers)
495
494
 
496
- self.assert_equal('201', response.status_code)
497
- end
495
+ assert_equal('201', response.status_code)
496
+ end
498
497
 
499
- def test_campaigns__campaign_id__schedules_get
500
- campaign_id = "test_url_param"
501
- headers = JSON.parse('{"X-Mock": 200}')
498
+ def test_campaigns__campaign_id__schedules_get
499
+ campaign_id = 'test_url_param'
500
+ headers = JSON.parse('{"X-Mock": 200}')
502
501
 
503
- response = @sg.client.campaigns._(campaign_id).schedules.get(request_headers: headers)
502
+ response = @sg.client.campaigns._(campaign_id).schedules.get(request_headers: headers)
504
503
 
505
- self.assert_equal('200', response.status_code)
506
- end
504
+ assert_equal('200', response.status_code)
505
+ end
507
506
 
508
- def test_campaigns__campaign_id__schedules_delete
509
- campaign_id = "test_url_param"
510
- headers = JSON.parse('{"X-Mock": 204}')
507
+ def test_campaigns__campaign_id__schedules_delete
508
+ campaign_id = 'test_url_param'
509
+ headers = JSON.parse('{"X-Mock": 204}')
511
510
 
512
- response = @sg.client.campaigns._(campaign_id).schedules.delete(request_headers: headers)
511
+ response = @sg.client.campaigns._(campaign_id).schedules.delete(request_headers: headers)
513
512
 
514
- self.assert_equal('204', response.status_code)
515
- end
513
+ assert_equal('204', response.status_code)
514
+ end
516
515
 
517
- def test_campaigns__campaign_id__schedules_now_post
518
- campaign_id = "test_url_param"
519
- headers = JSON.parse('{"X-Mock": 201}')
516
+ def test_campaigns__campaign_id__schedules_now_post
517
+ campaign_id = 'test_url_param'
518
+ headers = JSON.parse('{"X-Mock": 201}')
520
519
 
521
- response = @sg.client.campaigns._(campaign_id).schedules.now.post(request_headers: headers)
520
+ response = @sg.client.campaigns._(campaign_id).schedules.now.post(request_headers: headers)
522
521
 
523
- self.assert_equal('201', response.status_code)
524
- end
522
+ assert_equal('201', response.status_code)
523
+ end
525
524
 
526
- def test_campaigns__campaign_id__schedules_test_post
527
- data = JSON.parse('{
528
- "to": "your.email@example.com"
525
+ def test_campaigns__campaign_id__schedules_test_post
526
+ data = JSON.parse('{
527
+ "to": "your.email@example.com"
529
528
  }')
530
- campaign_id = "test_url_param"
531
- headers = JSON.parse('{"X-Mock": 204}')
529
+ campaign_id = 'test_url_param'
530
+ headers = JSON.parse('{"X-Mock": 204}')
532
531
 
533
- response = @sg.client.campaigns._(campaign_id).schedules.test.post(request_body: data, request_headers: headers)
532
+ response = @sg.client.campaigns._(campaign_id).schedules.test.post(request_body: data, request_headers: headers)
534
533
 
535
- self.assert_equal('204', response.status_code)
536
- end
534
+ assert_equal('204', response.status_code)
535
+ end
537
536
 
538
- def test_categories_get
539
- params = JSON.parse('{"category": "test_string", "limit": 1, "offset": 1}')
540
- headers = JSON.parse('{"X-Mock": 200}')
537
+ def test_categories_get
538
+ params = JSON.parse('{"category": "test_string", "limit": 1, "offset": 1}')
539
+ headers = JSON.parse('{"X-Mock": 200}')
541
540
 
542
- response = @sg.client.categories.get(query_params: params, request_headers: headers)
541
+ response = @sg.client.categories.get(query_params: params, request_headers: headers)
543
542
 
544
- self.assert_equal('200', response.status_code)
545
- end
543
+ assert_equal('200', response.status_code)
544
+ end
546
545
 
547
- def test_categories_stats_get
548
- params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "categories": "test_string"}')
549
- headers = JSON.parse('{"X-Mock": 200}')
546
+ def test_categories_stats_get
547
+ params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "categories": "test_string"}')
548
+ headers = JSON.parse('{"X-Mock": 200}')
550
549
 
551
- response = @sg.client.categories.stats.get(query_params: params, request_headers: headers)
550
+ response = @sg.client.categories.stats.get(query_params: params, request_headers: headers)
552
551
 
553
- self.assert_equal('200', response.status_code)
554
- end
552
+ assert_equal('200', response.status_code)
553
+ end
555
554
 
556
- def test_categories_stats_sums_get
557
- params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}')
558
- headers = JSON.parse('{"X-Mock": 200}')
555
+ def test_categories_stats_sums_get
556
+ params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}')
557
+ headers = JSON.parse('{"X-Mock": 200}')
559
558
 
560
- response = @sg.client.categories.stats.sums.get(query_params: params, request_headers: headers)
559
+ response = @sg.client.categories.stats.sums.get(query_params: params, request_headers: headers)
561
560
 
562
- self.assert_equal('200', response.status_code)
563
- end
561
+ assert_equal('200', response.status_code)
562
+ end
564
563
 
565
- def test_clients_stats_get
566
- params = JSON.parse('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}')
567
- headers = JSON.parse('{"X-Mock": 200}')
564
+ def test_clients_stats_get
565
+ params = JSON.parse('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}')
566
+ headers = JSON.parse('{"X-Mock": 200}')
568
567
 
569
- response = @sg.client.clients.stats.get(query_params: params, request_headers: headers)
568
+ response = @sg.client.clients.stats.get(query_params: params, request_headers: headers)
570
569
 
571
- self.assert_equal('200', response.status_code)
572
- end
570
+ assert_equal('200', response.status_code)
571
+ end
573
572
 
574
- def test_clients__client_type__stats_get
575
- params = JSON.parse('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}')
576
- client_type = "test_url_param"
577
- headers = JSON.parse('{"X-Mock": 200}')
573
+ def test_clients__client_type__stats_get
574
+ params = JSON.parse('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}')
575
+ client_type = 'test_url_param'
576
+ headers = JSON.parse('{"X-Mock": 200}')
578
577
 
579
- response = @sg.client.clients._(client_type).stats.get(query_params: params, request_headers: headers)
578
+ response = @sg.client.clients._(client_type).stats.get(query_params: params, request_headers: headers)
580
579
 
581
- self.assert_equal('200', response.status_code)
582
- end
580
+ assert_equal('200', response.status_code)
581
+ end
583
582
 
584
- def test_contactdb_custom_fields_post
585
- data = JSON.parse('{
586
- "name": "pet",
587
- "type": "text"
583
+ def test_contactdb_custom_fields_post
584
+ data = JSON.parse('{
585
+ "name": "pet",
586
+ "type": "text"
588
587
  }')
589
- headers = JSON.parse('{"X-Mock": 201}')
588
+ headers = JSON.parse('{"X-Mock": 201}')
590
589
 
591
- response = @sg.client.contactdb.custom_fields.post(request_body: data, request_headers: headers)
590
+ response = @sg.client.contactdb.custom_fields.post(request_body: data, request_headers: headers)
592
591
 
593
- self.assert_equal('201', response.status_code)
594
- end
592
+ assert_equal('201', response.status_code)
593
+ end
595
594
 
596
- def test_contactdb_custom_fields_get
597
- headers = JSON.parse('{"X-Mock": 200}')
595
+ def test_contactdb_custom_fields_get
596
+ headers = JSON.parse('{"X-Mock": 200}')
598
597
 
599
- response = @sg.client.contactdb.custom_fields.get(request_headers: headers)
598
+ response = @sg.client.contactdb.custom_fields.get(request_headers: headers)
600
599
 
601
- self.assert_equal('200', response.status_code)
602
- end
600
+ assert_equal('200', response.status_code)
601
+ end
603
602
 
604
- def test_contactdb_custom_fields__custom_field_id__get
605
- custom_field_id = "test_url_param"
606
- headers = JSON.parse('{"X-Mock": 200}')
603
+ def test_contactdb_custom_fields__custom_field_id__get
604
+ custom_field_id = 'test_url_param'
605
+ headers = JSON.parse('{"X-Mock": 200}')
607
606
 
608
- response = @sg.client.contactdb.custom_fields._(custom_field_id).get(request_headers: headers)
607
+ response = @sg.client.contactdb.custom_fields._(custom_field_id).get(request_headers: headers)
609
608
 
610
- self.assert_equal('200', response.status_code)
611
- end
609
+ assert_equal('200', response.status_code)
610
+ end
612
611
 
613
- def test_contactdb_custom_fields__custom_field_id__delete
614
- custom_field_id = "test_url_param"
615
- headers = JSON.parse('{"X-Mock": 202}')
612
+ def test_contactdb_custom_fields__custom_field_id__delete
613
+ custom_field_id = 'test_url_param'
614
+ headers = JSON.parse('{"X-Mock": 202}')
616
615
 
617
- response = @sg.client.contactdb.custom_fields._(custom_field_id).delete(request_headers: headers)
616
+ response = @sg.client.contactdb.custom_fields._(custom_field_id).delete(request_headers: headers)
618
617
 
619
- self.assert_equal('202', response.status_code)
620
- end
618
+ assert_equal('202', response.status_code)
619
+ end
621
620
 
622
- def test_contactdb_lists_post
623
- data = JSON.parse('{
624
- "name": "your list name"
621
+ def test_contactdb_lists_post
622
+ data = JSON.parse('{
623
+ "name": "your list name"
625
624
  }')
626
- headers = JSON.parse('{"X-Mock": 201}')
625
+ headers = JSON.parse('{"X-Mock": 201}')
627
626
 
628
- response = @sg.client.contactdb.lists.post(request_body: data, request_headers: headers)
627
+ response = @sg.client.contactdb.lists.post(request_body: data, request_headers: headers)
629
628
 
630
- self.assert_equal('201', response.status_code)
631
- end
629
+ assert_equal('201', response.status_code)
630
+ end
632
631
 
633
- def test_contactdb_lists_get
634
- headers = JSON.parse('{"X-Mock": 200}')
632
+ def test_contactdb_lists_get
633
+ headers = JSON.parse('{"X-Mock": 200}')
635
634
 
636
- response = @sg.client.contactdb.lists.get(request_headers: headers)
635
+ response = @sg.client.contactdb.lists.get(request_headers: headers)
637
636
 
638
- self.assert_equal('200', response.status_code)
639
- end
637
+ assert_equal('200', response.status_code)
638
+ end
640
639
 
641
- def test_contactdb_lists_delete
642
- data = JSON.parse('[
643
- 1,
644
- 2,
645
- 3,
646
- 4
640
+ def test_contactdb_lists_delete
641
+ data = JSON.parse('[
642
+ 1,
643
+ 2,
644
+ 3,
645
+ 4
647
646
  ]')
648
- headers = JSON.parse('{"X-Mock": 204}')
647
+ headers = JSON.parse('{"X-Mock": 204}')
649
648
 
650
- response = @sg.client.contactdb.lists.delete(request_body: data, request_headers: headers)
649
+ response = @sg.client.contactdb.lists.delete(request_body: data, request_headers: headers)
651
650
 
652
- self.assert_equal('204', response.status_code)
653
- end
651
+ assert_equal('204', response.status_code)
652
+ end
654
653
 
655
- def test_contactdb_lists__list_id__patch
656
- data = JSON.parse('{
657
- "name": "newlistname"
654
+ def test_contactdb_lists__list_id__patch
655
+ data = JSON.parse('{
656
+ "name": "newlistname"
658
657
  }')
659
- params = JSON.parse('{"list_id": 1}')
660
- list_id = "test_url_param"
661
- headers = JSON.parse('{"X-Mock": 200}')
658
+ params = JSON.parse('{"list_id": 1}')
659
+ list_id = 'test_url_param'
660
+ headers = JSON.parse('{"X-Mock": 200}')
662
661
 
663
- response = @sg.client.contactdb.lists._(list_id).patch(request_body: data, query_params: params, request_headers: headers)
662
+ response = @sg.client.contactdb.lists._(list_id).patch(request_body: data, query_params: params, request_headers: headers)
664
663
 
665
- self.assert_equal('200', response.status_code)
666
- end
664
+ assert_equal('200', response.status_code)
665
+ end
667
666
 
668
- def test_contactdb_lists__list_id__get
669
- params = JSON.parse('{"list_id": 1}')
670
- list_id = "test_url_param"
671
- headers = JSON.parse('{"X-Mock": 200}')
667
+ def test_contactdb_lists__list_id__get
668
+ params = JSON.parse('{"list_id": 1}')
669
+ list_id = 'test_url_param'
670
+ headers = JSON.parse('{"X-Mock": 200}')
672
671
 
673
- response = @sg.client.contactdb.lists._(list_id).get(query_params: params, request_headers: headers)
672
+ response = @sg.client.contactdb.lists._(list_id).get(query_params: params, request_headers: headers)
674
673
 
675
- self.assert_equal('200', response.status_code)
676
- end
674
+ assert_equal('200', response.status_code)
675
+ end
677
676
 
678
- def test_contactdb_lists__list_id__delete
679
- params = JSON.parse('{"delete_contacts": "true"}')
680
- list_id = "test_url_param"
681
- headers = JSON.parse('{"X-Mock": 202}')
677
+ def test_contactdb_lists__list_id__delete
678
+ params = JSON.parse('{"delete_contacts": "true"}')
679
+ list_id = 'test_url_param'
680
+ headers = JSON.parse('{"X-Mock": 202}')
682
681
 
683
- response = @sg.client.contactdb.lists._(list_id).delete(query_params: params, request_headers: headers)
682
+ response = @sg.client.contactdb.lists._(list_id).delete(query_params: params, request_headers: headers)
684
683
 
685
- self.assert_equal('202', response.status_code)
686
- end
684
+ assert_equal('202', response.status_code)
685
+ end
687
686
 
688
- def test_contactdb_lists__list_id__recipients_post
689
- data = JSON.parse('[
690
- "recipient_id1",
691
- "recipient_id2"
687
+ def test_contactdb_lists__list_id__recipients_post
688
+ data = JSON.parse('[
689
+ "recipient_id1",
690
+ "recipient_id2"
692
691
  ]')
693
- list_id = "test_url_param"
694
- headers = JSON.parse('{"X-Mock": 201}')
692
+ list_id = 'test_url_param'
693
+ headers = JSON.parse('{"X-Mock": 201}')
695
694
 
696
- response = @sg.client.contactdb.lists._(list_id).recipients.post(request_body: data, request_headers: headers)
695
+ response = @sg.client.contactdb.lists._(list_id).recipients.post(request_body: data, request_headers: headers)
697
696
 
698
- self.assert_equal('201', response.status_code)
699
- end
697
+ assert_equal('201', response.status_code)
698
+ end
700
699
 
701
- def test_contactdb_lists__list_id__recipients_get
702
- params = JSON.parse('{"page": 1, "page_size": 1, "list_id": 1}')
703
- list_id = "test_url_param"
704
- headers = JSON.parse('{"X-Mock": 200}')
700
+ def test_contactdb_lists__list_id__recipients_get
701
+ params = JSON.parse('{"page": 1, "page_size": 1, "list_id": 1}')
702
+ list_id = 'test_url_param'
703
+ headers = JSON.parse('{"X-Mock": 200}')
705
704
 
706
- response = @sg.client.contactdb.lists._(list_id).recipients.get(query_params: params, request_headers: headers)
705
+ response = @sg.client.contactdb.lists._(list_id).recipients.get(query_params: params, request_headers: headers)
707
706
 
708
- self.assert_equal('200', response.status_code)
709
- end
707
+ assert_equal('200', response.status_code)
708
+ end
710
709
 
711
- def test_contactdb_lists__list_id__recipients__recipient_id__post
712
- list_id = "test_url_param"
713
- recipient_id = "test_url_param"
714
- headers = JSON.parse('{"X-Mock": 201}')
710
+ def test_contactdb_lists__list_id__recipients__recipient_id__post
711
+ list_id = 'test_url_param'
712
+ recipient_id = 'test_url_param'
713
+ headers = JSON.parse('{"X-Mock": 201}')
715
714
 
716
- response = @sg.client.contactdb.lists._(list_id).recipients._(recipient_id).post(request_headers: headers)
715
+ response = @sg.client.contactdb.lists._(list_id).recipients._(recipient_id).post(request_headers: headers)
717
716
 
718
- self.assert_equal('201', response.status_code)
719
- end
717
+ assert_equal('201', response.status_code)
718
+ end
720
719
 
721
- def test_contactdb_lists__list_id__recipients__recipient_id__delete
722
- params = JSON.parse('{"recipient_id": 1, "list_id": 1}')
723
- list_id = "test_url_param"
724
- recipient_id = "test_url_param"
725
- headers = JSON.parse('{"X-Mock": 204}')
720
+ def test_contactdb_lists__list_id__recipients__recipient_id__delete
721
+ params = JSON.parse('{"recipient_id": 1, "list_id": 1}')
722
+ list_id = 'test_url_param'
723
+ recipient_id = 'test_url_param'
724
+ headers = JSON.parse('{"X-Mock": 204}')
726
725
 
727
- response = @sg.client.contactdb.lists._(list_id).recipients._(recipient_id).delete(query_params: params, request_headers: headers)
726
+ response = @sg.client.contactdb.lists._(list_id).recipients._(recipient_id).delete(query_params: params, request_headers: headers)
728
727
 
729
- self.assert_equal('204', response.status_code)
730
- end
728
+ assert_equal('204', response.status_code)
729
+ end
731
730
 
732
- def test_contactdb_recipients_patch
733
- data = JSON.parse('[
734
- {
735
- "email": "jones@example.com",
736
- "first_name": "Guy",
737
- "last_name": "Jones"
738
- }
731
+ def test_contactdb_recipients_patch
732
+ data = JSON.parse('[
733
+ {
734
+ "email": "jones@example.com",
735
+ "first_name": "Guy",
736
+ "last_name": "Jones"
737
+ }
739
738
  ]')
740
- headers = JSON.parse('{"X-Mock": 201}')
741
-
742
- response = @sg.client.contactdb.recipients.patch(request_body: data, request_headers: headers)
743
-
744
- self.assert_equal('201', response.status_code)
745
- end
746
-
747
- def test_contactdb_recipients_post
748
- data = JSON.parse('[
749
- {
750
- "age": 25,
751
- "email": "example@example.com",
752
- "first_name": "",
753
- "last_name": "User"
754
- },
755
- {
756
- "age": 25,
757
- "email": "example2@example.com",
758
- "first_name": "Example",
759
- "last_name": "User"
760
- }
739
+ headers = JSON.parse('{"X-Mock": 201}')
740
+
741
+ response = @sg.client.contactdb.recipients.patch(request_body: data, request_headers: headers)
742
+
743
+ assert_equal('201', response.status_code)
744
+ end
745
+
746
+ def test_contactdb_recipients_post
747
+ data = JSON.parse('[
748
+ {
749
+ "age": 25,
750
+ "email": "example@example.com",
751
+ "first_name": "",
752
+ "last_name": "User"
753
+ },
754
+ {
755
+ "age": 25,
756
+ "email": "example2@example.com",
757
+ "first_name": "Example",
758
+ "last_name": "User"
759
+ }
761
760
  ]')
762
- headers = JSON.parse('{"X-Mock": 201}')
761
+ headers = JSON.parse('{"X-Mock": 201}')
763
762
 
764
- response = @sg.client.contactdb.recipients.post(request_body: data, request_headers: headers)
763
+ response = @sg.client.contactdb.recipients.post(request_body: data, request_headers: headers)
765
764
 
766
- self.assert_equal('201', response.status_code)
767
- end
765
+ assert_equal('201', response.status_code)
766
+ end
768
767
 
769
- def test_contactdb_recipients_get
770
- params = JSON.parse('{"page": 1, "page_size": 1}')
771
- headers = JSON.parse('{"X-Mock": 200}')
768
+ def test_contactdb_recipients_get
769
+ params = JSON.parse('{"page": 1, "page_size": 1}')
770
+ headers = JSON.parse('{"X-Mock": 200}')
772
771
 
773
- response = @sg.client.contactdb.recipients.get(query_params: params, request_headers: headers)
772
+ response = @sg.client.contactdb.recipients.get(query_params: params, request_headers: headers)
774
773
 
775
- self.assert_equal('200', response.status_code)
776
- end
774
+ assert_equal('200', response.status_code)
775
+ end
777
776
 
778
- def test_contactdb_recipients_delete
779
- data = JSON.parse('[
780
- "recipient_id1",
781
- "recipient_id2"
777
+ def test_contactdb_recipients_delete
778
+ data = JSON.parse('[
779
+ "recipient_id1",
780
+ "recipient_id2"
782
781
  ]')
783
- headers = JSON.parse('{"X-Mock": 200}')
782
+ headers = JSON.parse('{"X-Mock": 200}')
784
783
 
785
- response = @sg.client.contactdb.recipients.delete(request_body: data, request_headers: headers)
784
+ response = @sg.client.contactdb.recipients.delete(request_body: data, request_headers: headers)
786
785
 
787
- self.assert_equal('200', response.status_code)
788
- end
786
+ assert_equal('200', response.status_code)
787
+ end
789
788
 
790
- def test_contactdb_recipients_billable_count_get
791
- headers = JSON.parse('{"X-Mock": 200}')
789
+ def test_contactdb_recipients_billable_count_get
790
+ headers = JSON.parse('{"X-Mock": 200}')
792
791
 
793
- response = @sg.client.contactdb.recipients.billable_count.get(request_headers: headers)
792
+ response = @sg.client.contactdb.recipients.billable_count.get(request_headers: headers)
794
793
 
795
- self.assert_equal('200', response.status_code)
796
- end
794
+ assert_equal('200', response.status_code)
795
+ end
797
796
 
798
- def test_contactdb_recipients_count_get
799
- headers = JSON.parse('{"X-Mock": 200}')
797
+ def test_contactdb_recipients_count_get
798
+ headers = JSON.parse('{"X-Mock": 200}')
800
799
 
801
- response = @sg.client.contactdb.recipients.count.get(request_headers: headers)
800
+ response = @sg.client.contactdb.recipients.count.get(request_headers: headers)
802
801
 
803
- self.assert_equal('200', response.status_code)
804
- end
802
+ assert_equal('200', response.status_code)
803
+ end
805
804
 
806
- def test_contactdb_recipients_search_get
807
- params = { field_name: "test_string" }
808
- headers = JSON.parse('{"X-Mock": 200}')
805
+ def test_contactdb_recipients_search_get
806
+ params = { field_name: 'test_string' }
807
+ headers = JSON.parse('{"X-Mock": 200}')
809
808
 
810
- response = @sg.client.contactdb.recipients.search.get(query_params: params, request_headers: headers)
809
+ response = @sg.client.contactdb.recipients.search.get(query_params: params, request_headers: headers)
811
810
 
812
- self.assert_equal('200', response.status_code)
813
- end
811
+ assert_equal('200', response.status_code)
812
+ end
814
813
 
815
- def test_contactdb_recipients__recipient_id__get
816
- recipient_id = "test_url_param"
817
- headers = JSON.parse('{"X-Mock": 200}')
814
+ def test_contactdb_recipients__recipient_id__get
815
+ recipient_id = 'test_url_param'
816
+ headers = JSON.parse('{"X-Mock": 200}')
818
817
 
819
- response = @sg.client.contactdb.recipients._(recipient_id).get(request_headers: headers)
818
+ response = @sg.client.contactdb.recipients._(recipient_id).get(request_headers: headers)
820
819
 
821
- self.assert_equal('200', response.status_code)
822
- end
820
+ assert_equal('200', response.status_code)
821
+ end
823
822
 
824
- def test_contactdb_recipients__recipient_id__delete
825
- recipient_id = "test_url_param"
826
- headers = JSON.parse('{"X-Mock": 204}')
823
+ def test_contactdb_recipients__recipient_id__delete
824
+ recipient_id = 'test_url_param'
825
+ headers = JSON.parse('{"X-Mock": 204}')
827
826
 
828
- response = @sg.client.contactdb.recipients._(recipient_id).delete(request_headers: headers)
827
+ response = @sg.client.contactdb.recipients._(recipient_id).delete(request_headers: headers)
829
828
 
830
- self.assert_equal('204', response.status_code)
831
- end
829
+ assert_equal('204', response.status_code)
830
+ end
832
831
 
833
- def test_contactdb_recipients__recipient_id__lists_get
834
- recipient_id = "test_url_param"
835
- headers = JSON.parse('{"X-Mock": 200}')
832
+ def test_contactdb_recipients__recipient_id__lists_get
833
+ recipient_id = 'test_url_param'
834
+ headers = JSON.parse('{"X-Mock": 200}')
836
835
 
837
- response = @sg.client.contactdb.recipients._(recipient_id).lists.get(request_headers: headers)
836
+ response = @sg.client.contactdb.recipients._(recipient_id).lists.get(request_headers: headers)
838
837
 
839
- self.assert_equal('200', response.status_code)
840
- end
838
+ assert_equal('200', response.status_code)
839
+ end
841
840
 
842
- def test_contactdb_reserved_fields_get
843
- headers = JSON.parse('{"X-Mock": 200}')
841
+ def test_contactdb_reserved_fields_get
842
+ headers = JSON.parse('{"X-Mock": 200}')
844
843
 
845
- response = @sg.client.contactdb.reserved_fields.get(request_headers: headers)
844
+ response = @sg.client.contactdb.reserved_fields.get(request_headers: headers)
846
845
 
847
- self.assert_equal('200', response.status_code)
848
- end
846
+ assert_equal('200', response.status_code)
847
+ end
849
848
 
850
- def test_contactdb_segments_post
851
- data = JSON.parse('{
852
- "conditions": [
853
- {
854
- "and_or": "",
855
- "field": "last_name",
856
- "operator": "eq",
857
- "value": "Miller"
858
- },
859
- {
860
- "and_or": "and",
861
- "field": "last_clicked",
862
- "operator": "gt",
863
- "value": "01/02/2015"
864
- },
865
- {
866
- "and_or": "or",
867
- "field": "clicks.campaign_identifier",
868
- "operator": "eq",
869
- "value": "513"
870
- }
871
- ],
872
- "list_id": 4,
873
- "name": "Last Name Miller"
849
+ def test_contactdb_segments_post
850
+ data = JSON.parse('{
851
+ "conditions": [
852
+ {
853
+ "and_or": "",
854
+ "field": "last_name",
855
+ "operator": "eq",
856
+ "value": "Miller"
857
+ },
858
+ {
859
+ "and_or": "and",
860
+ "field": "last_clicked",
861
+ "operator": "gt",
862
+ "value": "01/02/2015"
863
+ },
864
+ {
865
+ "and_or": "or",
866
+ "field": "clicks.campaign_identifier",
867
+ "operator": "eq",
868
+ "value": "513"
869
+ }
870
+ ],
871
+ "list_id": 4,
872
+ "name": "Last Name Miller"
874
873
  }')
875
- headers = JSON.parse('{"X-Mock": 200}')
874
+ headers = JSON.parse('{"X-Mock": 200}')
876
875
 
877
- response = @sg.client.contactdb.segments.post(request_body: data, request_headers: headers)
876
+ response = @sg.client.contactdb.segments.post(request_body: data, request_headers: headers)
878
877
 
879
- self.assert_equal('200', response.status_code)
880
- end
878
+ assert_equal('200', response.status_code)
879
+ end
881
880
 
882
- def test_contactdb_segments_get
883
- headers = JSON.parse('{"X-Mock": 200}')
881
+ def test_contactdb_segments_get
882
+ headers = JSON.parse('{"X-Mock": 200}')
884
883
 
885
- response = @sg.client.contactdb.segments.get(request_headers: headers)
884
+ response = @sg.client.contactdb.segments.get(request_headers: headers)
886
885
 
887
- self.assert_equal('200', response.status_code)
888
- end
886
+ assert_equal('200', response.status_code)
887
+ end
889
888
 
890
- def test_contactdb_segments__segment_id__patch
891
- data = JSON.parse('{
892
- "conditions": [
893
- {
894
- "and_or": "",
895
- "field": "last_name",
896
- "operator": "eq",
897
- "value": "Miller"
898
- }
899
- ],
900
- "list_id": 5,
901
- "name": "The Millers"
889
+ def test_contactdb_segments__segment_id__patch
890
+ data = JSON.parse('{
891
+ "conditions": [
892
+ {
893
+ "and_or": "",
894
+ "field": "last_name",
895
+ "operator": "eq",
896
+ "value": "Miller"
897
+ }
898
+ ],
899
+ "list_id": 5,
900
+ "name": "The Millers"
902
901
  }')
903
- params = JSON.parse('{"segment_id": "test_string"}')
904
- segment_id = "test_url_param"
905
- headers = JSON.parse('{"X-Mock": 200}')
902
+ params = JSON.parse('{"segment_id": "test_string"}')
903
+ segment_id = 'test_url_param'
904
+ headers = JSON.parse('{"X-Mock": 200}')
906
905
 
907
- response = @sg.client.contactdb.segments._(segment_id).patch(request_body: data, query_params: params, request_headers: headers)
906
+ response = @sg.client.contactdb.segments._(segment_id).patch(request_body: data, query_params: params, request_headers: headers)
908
907
 
909
- self.assert_equal('200', response.status_code)
910
- end
908
+ assert_equal('200', response.status_code)
909
+ end
911
910
 
912
- def test_contactdb_segments__segment_id__get
913
- params = JSON.parse('{"segment_id": 1}')
914
- segment_id = "test_url_param"
915
- headers = JSON.parse('{"X-Mock": 200}')
911
+ def test_contactdb_segments__segment_id__get
912
+ params = JSON.parse('{"segment_id": 1}')
913
+ segment_id = 'test_url_param'
914
+ headers = JSON.parse('{"X-Mock": 200}')
916
915
 
917
- response = @sg.client.contactdb.segments._(segment_id).get(query_params: params, request_headers: headers)
916
+ response = @sg.client.contactdb.segments._(segment_id).get(query_params: params, request_headers: headers)
918
917
 
919
- self.assert_equal('200', response.status_code)
920
- end
918
+ assert_equal('200', response.status_code)
919
+ end
921
920
 
922
- def test_contactdb_segments__segment_id__delete
923
- params = JSON.parse('{"delete_contacts": "true"}')
924
- segment_id = "test_url_param"
925
- headers = JSON.parse('{"X-Mock": 204}')
921
+ def test_contactdb_segments__segment_id__delete
922
+ params = JSON.parse('{"delete_contacts": "true"}')
923
+ segment_id = 'test_url_param'
924
+ headers = JSON.parse('{"X-Mock": 204}')
926
925
 
927
- response = @sg.client.contactdb.segments._(segment_id).delete(query_params: params, request_headers: headers)
926
+ response = @sg.client.contactdb.segments._(segment_id).delete(query_params: params, request_headers: headers)
928
927
 
929
- self.assert_equal('204', response.status_code)
930
- end
928
+ assert_equal('204', response.status_code)
929
+ end
931
930
 
932
- def test_contactdb_segments__segment_id__recipients_get
933
- params = JSON.parse('{"page": 1, "page_size": 1}')
934
- segment_id = "test_url_param"
935
- headers = JSON.parse('{"X-Mock": 200}')
931
+ def test_contactdb_segments__segment_id__recipients_get
932
+ params = JSON.parse('{"page": 1, "page_size": 1}')
933
+ segment_id = 'test_url_param'
934
+ headers = JSON.parse('{"X-Mock": 200}')
936
935
 
937
- response = @sg.client.contactdb.segments._(segment_id).recipients.get(query_params: params, request_headers: headers)
936
+ response = @sg.client.contactdb.segments._(segment_id).recipients.get(query_params: params, request_headers: headers)
938
937
 
939
- self.assert_equal('200', response.status_code)
940
- end
938
+ assert_equal('200', response.status_code)
939
+ end
941
940
 
942
- def test_devices_stats_get
943
- params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}')
944
- headers = JSON.parse('{"X-Mock": 200}')
941
+ def test_devices_stats_get
942
+ params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}')
943
+ headers = JSON.parse('{"X-Mock": 200}')
945
944
 
946
- response = @sg.client.devices.stats.get(query_params: params, request_headers: headers)
945
+ response = @sg.client.devices.stats.get(query_params: params, request_headers: headers)
947
946
 
948
- self.assert_equal('200', response.status_code)
949
- end
947
+ assert_equal('200', response.status_code)
948
+ end
950
949
 
951
- def test_geo_stats_get
952
- params = JSON.parse('{"end_date": "2016-04-01", "country": "US", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}')
953
- headers = JSON.parse('{"X-Mock": 200}')
950
+ def test_geo_stats_get
951
+ params = JSON.parse('{"end_date": "2016-04-01", "country": "US", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}')
952
+ headers = JSON.parse('{"X-Mock": 200}')
954
953
 
955
- response = @sg.client.geo.stats.get(query_params: params, request_headers: headers)
954
+ response = @sg.client.geo.stats.get(query_params: params, request_headers: headers)
956
955
 
957
- self.assert_equal('200', response.status_code)
958
- end
956
+ assert_equal('200', response.status_code)
957
+ end
959
958
 
960
- def test_ips_get
961
- params = JSON.parse('{"subuser": "test_string", "ip": "test_string", "limit": 1, "exclude_whitelabels": "true", "offset": 1}')
962
- headers = JSON.parse('{"X-Mock": 200}')
959
+ def test_ips_get
960
+ params = JSON.parse('{"subuser": "test_string", "ip": "test_string", "limit": 1, "exclude_whitelabels": "true", "offset": 1}')
961
+ headers = JSON.parse('{"X-Mock": 200}')
963
962
 
964
- response = @sg.client.ips.get(query_params: params, request_headers: headers)
963
+ response = @sg.client.ips.get(query_params: params, request_headers: headers)
965
964
 
966
- self.assert_equal('200', response.status_code)
967
- end
965
+ assert_equal('200', response.status_code)
966
+ end
968
967
 
969
- def test_ips_assigned_get
970
- headers = JSON.parse('{"X-Mock": 200}')
968
+ def test_ips_assigned_get
969
+ headers = JSON.parse('{"X-Mock": 200}')
971
970
 
972
- response = @sg.client.ips.assigned.get(request_headers: headers)
971
+ response = @sg.client.ips.assigned.get(request_headers: headers)
973
972
 
974
- self.assert_equal('200', response.status_code)
975
- end
973
+ assert_equal('200', response.status_code)
974
+ end
976
975
 
977
- def test_ips_pools_post
978
- data = JSON.parse('{
979
- "name": "marketing"
976
+ def test_ips_pools_post
977
+ data = JSON.parse('{
978
+ "name": "marketing"
980
979
  }')
981
- headers = JSON.parse('{"X-Mock": 200}')
980
+ headers = JSON.parse('{"X-Mock": 200}')
982
981
 
983
- response = @sg.client.ips.pools.post(request_body: data, request_headers: headers)
982
+ response = @sg.client.ips.pools.post(request_body: data, request_headers: headers)
984
983
 
985
- self.assert_equal('200', response.status_code)
986
- end
984
+ assert_equal('200', response.status_code)
985
+ end
987
986
 
988
- def test_ips_pools_get
989
- headers = JSON.parse('{"X-Mock": 200}')
987
+ def test_ips_pools_get
988
+ headers = JSON.parse('{"X-Mock": 200}')
990
989
 
991
- response = @sg.client.ips.pools.get(request_headers: headers)
990
+ response = @sg.client.ips.pools.get(request_headers: headers)
992
991
 
993
- self.assert_equal('200', response.status_code)
994
- end
992
+ assert_equal('200', response.status_code)
993
+ end
995
994
 
996
- def test_ips_pools__pool_name__put
997
- data = JSON.parse('{
998
- "name": "new_pool_name"
995
+ def test_ips_pools__pool_name__put
996
+ data = JSON.parse('{
997
+ "name": "new_pool_name"
999
998
  }')
1000
- pool_name = "test_url_param"
1001
- headers = JSON.parse('{"X-Mock": 200}')
999
+ pool_name = 'test_url_param'
1000
+ headers = JSON.parse('{"X-Mock": 200}')
1002
1001
 
1003
- response = @sg.client.ips.pools._(pool_name).put(request_body: data, request_headers: headers)
1002
+ response = @sg.client.ips.pools._(pool_name).put(request_body: data, request_headers: headers)
1004
1003
 
1005
- self.assert_equal('200', response.status_code)
1006
- end
1004
+ assert_equal('200', response.status_code)
1005
+ end
1007
1006
 
1008
- def test_ips_pools__pool_name__get
1009
- pool_name = "test_url_param"
1010
- headers = JSON.parse('{"X-Mock": 200}')
1007
+ def test_ips_pools__pool_name__get
1008
+ pool_name = 'test_url_param'
1009
+ headers = JSON.parse('{"X-Mock": 200}')
1011
1010
 
1012
- response = @sg.client.ips.pools._(pool_name).get(request_headers: headers)
1011
+ response = @sg.client.ips.pools._(pool_name).get(request_headers: headers)
1013
1012
 
1014
- self.assert_equal('200', response.status_code)
1015
- end
1013
+ assert_equal('200', response.status_code)
1014
+ end
1016
1015
 
1017
- def test_ips_pools__pool_name__delete
1018
- pool_name = "test_url_param"
1019
- headers = JSON.parse('{"X-Mock": 204}')
1016
+ def test_ips_pools__pool_name__delete
1017
+ pool_name = 'test_url_param'
1018
+ headers = JSON.parse('{"X-Mock": 204}')
1020
1019
 
1021
- response = @sg.client.ips.pools._(pool_name).delete(request_headers: headers)
1020
+ response = @sg.client.ips.pools._(pool_name).delete(request_headers: headers)
1022
1021
 
1023
- self.assert_equal('204', response.status_code)
1024
- end
1022
+ assert_equal('204', response.status_code)
1023
+ end
1025
1024
 
1026
- def test_ips_pools__pool_name__ips_post
1027
- data = JSON.parse('{
1028
- "ip": "0.0.0.0"
1025
+ def test_ips_pools__pool_name__ips_post
1026
+ data = JSON.parse('{
1027
+ "ip": "0.0.0.0"
1029
1028
  }')
1030
- pool_name = "test_url_param"
1031
- headers = JSON.parse('{"X-Mock": 201}')
1029
+ pool_name = 'test_url_param'
1030
+ headers = JSON.parse('{"X-Mock": 201}')
1032
1031
 
1033
- response = @sg.client.ips.pools._(pool_name).ips.post(request_body: data, request_headers: headers)
1032
+ response = @sg.client.ips.pools._(pool_name).ips.post(request_body: data, request_headers: headers)
1034
1033
 
1035
- self.assert_equal('201', response.status_code)
1036
- end
1034
+ assert_equal('201', response.status_code)
1035
+ end
1037
1036
 
1038
- def test_ips_pools__pool_name__ips__ip__delete
1039
- pool_name = "test_url_param"
1040
- ip = "test_url_param"
1041
- headers = JSON.parse('{"X-Mock": 204}')
1037
+ def test_ips_pools__pool_name__ips__ip__delete
1038
+ pool_name = 'test_url_param'
1039
+ ip = 'test_url_param'
1040
+ headers = JSON.parse('{"X-Mock": 204}')
1042
1041
 
1043
- response = @sg.client.ips.pools._(pool_name).ips._(ip).delete(request_headers: headers)
1042
+ response = @sg.client.ips.pools._(pool_name).ips._(ip).delete(request_headers: headers)
1044
1043
 
1045
- self.assert_equal('204', response.status_code)
1046
- end
1044
+ assert_equal('204', response.status_code)
1045
+ end
1047
1046
 
1048
- def test_ips_warmup_post
1049
- data = JSON.parse('{
1050
- "ip": "0.0.0.0"
1047
+ def test_ips_warmup_post
1048
+ data = JSON.parse('{
1049
+ "ip": "0.0.0.0"
1051
1050
  }')
1052
- headers = JSON.parse('{"X-Mock": 200}')
1051
+ headers = JSON.parse('{"X-Mock": 200}')
1053
1052
 
1054
- response = @sg.client.ips.warmup.post(request_body: data, request_headers: headers)
1053
+ response = @sg.client.ips.warmup.post(request_body: data, request_headers: headers)
1055
1054
 
1056
- self.assert_equal('200', response.status_code)
1057
- end
1055
+ assert_equal('200', response.status_code)
1056
+ end
1058
1057
 
1059
- def test_ips_warmup_get
1060
- headers = JSON.parse('{"X-Mock": 200}')
1058
+ def test_ips_warmup_get
1059
+ headers = JSON.parse('{"X-Mock": 200}')
1061
1060
 
1062
- response = @sg.client.ips.warmup.get(request_headers: headers)
1061
+ response = @sg.client.ips.warmup.get(request_headers: headers)
1063
1062
 
1064
- self.assert_equal('200', response.status_code)
1065
- end
1063
+ assert_equal('200', response.status_code)
1064
+ end
1066
1065
 
1067
- def test_ips_warmup__ip_address__get
1068
- ip_address = "test_url_param"
1069
- headers = JSON.parse('{"X-Mock": 200}')
1066
+ def test_ips_warmup__ip_address__get
1067
+ ip_address = 'test_url_param'
1068
+ headers = JSON.parse('{"X-Mock": 200}')
1070
1069
 
1071
- response = @sg.client.ips.warmup._(ip_address).get(request_headers: headers)
1070
+ response = @sg.client.ips.warmup._(ip_address).get(request_headers: headers)
1072
1071
 
1073
- self.assert_equal('200', response.status_code)
1074
- end
1072
+ assert_equal('200', response.status_code)
1073
+ end
1075
1074
 
1076
- def test_ips_warmup__ip_address__delete
1077
- ip_address = "test_url_param"
1078
- headers = JSON.parse('{"X-Mock": 204}')
1075
+ def test_ips_warmup__ip_address__delete
1076
+ ip_address = 'test_url_param'
1077
+ headers = JSON.parse('{"X-Mock": 204}')
1079
1078
 
1080
- response = @sg.client.ips.warmup._(ip_address).delete(request_headers: headers)
1079
+ response = @sg.client.ips.warmup._(ip_address).delete(request_headers: headers)
1081
1080
 
1082
- self.assert_equal('204', response.status_code)
1083
- end
1081
+ assert_equal('204', response.status_code)
1082
+ end
1084
1083
 
1085
- def test_ips__ip_address__get
1086
- ip_address = "test_url_param"
1087
- headers = JSON.parse('{"X-Mock": 200}')
1084
+ def test_ips__ip_address__get
1085
+ ip_address = 'test_url_param'
1086
+ headers = JSON.parse('{"X-Mock": 200}')
1088
1087
 
1089
- response = @sg.client.ips._(ip_address).get(request_headers: headers)
1088
+ response = @sg.client.ips._(ip_address).get(request_headers: headers)
1090
1089
 
1091
- self.assert_equal('200', response.status_code)
1092
- end
1090
+ assert_equal('200', response.status_code)
1091
+ end
1093
1092
 
1094
- def test_mail_batch_post
1095
- headers = JSON.parse('{"X-Mock": 201}')
1093
+ def test_mail_batch_post
1094
+ headers = JSON.parse('{"X-Mock": 201}')
1096
1095
 
1097
- response = @sg.client.mail.batch.post(request_headers: headers)
1096
+ response = @sg.client.mail.batch.post(request_headers: headers)
1098
1097
 
1099
- self.assert_equal('201', response.status_code)
1100
- end
1098
+ assert_equal('201', response.status_code)
1099
+ end
1101
1100
 
1102
- def test_mail_batch__batch_id__get
1103
- batch_id = "test_url_param"
1104
- headers = JSON.parse('{"X-Mock": 200}')
1101
+ def test_mail_batch__batch_id__get
1102
+ batch_id = 'test_url_param'
1103
+ headers = JSON.parse('{"X-Mock": 200}')
1105
1104
 
1106
- response = @sg.client.mail.batch._(batch_id).get(request_headers: headers)
1105
+ response = @sg.client.mail.batch._(batch_id).get(request_headers: headers)
1107
1106
 
1108
- self.assert_equal('200', response.status_code)
1109
- end
1107
+ assert_equal('200', response.status_code)
1108
+ end
1110
1109
 
1111
- def test_mail_send_post
1112
- data = JSON.parse('{
1113
- "asm": {
1114
- "group_id": 1,
1115
- "groups_to_display": [
1116
- 1,
1117
- 2,
1118
- 3
1119
- ]
1120
- },
1121
- "attachments": [
1110
+ def test_mail_send_post
1111
+ data = JSON.parse('{
1112
+ "asm": {
1113
+ "group_id": 1,
1114
+ "groups_to_display": [
1115
+ 1,
1116
+ 2,
1117
+ 3
1118
+ ]
1119
+ },
1120
+ "attachments": [
1121
+ {
1122
+ "content": "[BASE64 encoded content block here]",
1123
+ "content_id": "ii_139db99fdb5c3704",
1124
+ "disposition": "inline",
1125
+ "filename": "file1.jpg",
1126
+ "name": "file1",
1127
+ "type": "jpg"
1128
+ }
1129
+ ],
1130
+ "batch_id": "[YOUR BATCH ID GOES HERE]",
1131
+ "categories": [
1132
+ "category1",
1133
+ "category2"
1134
+ ],
1135
+ "content": [
1136
+ {
1137
+ "type": "text/html",
1138
+ "value": "<html><p>Hello, world!</p><img src=[CID GOES HERE]></img></html>"
1139
+ }
1140
+ ],
1141
+ "custom_args": {
1142
+ "New Argument 1": "New Value 1",
1143
+ "activationAttempt": "1",
1144
+ "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]"
1145
+ },
1146
+ "from": {
1147
+ "email": "sam.smith@example.com",
1148
+ "name": "Sam Smith"
1149
+ },
1150
+ "headers": {},
1151
+ "ip_pool_name": "[YOUR POOL NAME GOES HERE]",
1152
+ "mail_settings": {
1153
+ "bcc": {
1154
+ "email": "ben.doe@example.com",
1155
+ "enable": true
1156
+ },
1157
+ "bypass_list_management": {
1158
+ "enable": true
1159
+ },
1160
+ "footer": {
1161
+ "enable": true,
1162
+ "html": "<p>Thanks</br>The SendGrid Team</p>",
1163
+ "text": "Thanks,/n The SendGrid Team"
1164
+ },
1165
+ "sandbox_mode": {
1166
+ "enable": false
1167
+ },
1168
+ "spam_check": {
1169
+ "enable": true,
1170
+ "post_to_url": "http://example.com/compliance",
1171
+ "threshold": 3
1172
+ }
1173
+ },
1174
+ "personalizations": [
1175
+ {
1176
+ "bcc": [
1122
1177
  {
1123
- "content": "[BASE64 encoded content block here]",
1124
- "content_id": "ii_139db99fdb5c3704",
1125
- "disposition": "inline",
1126
- "filename": "file1.jpg",
1127
- "name": "file1",
1128
- "type": "jpg"
1178
+ "email": "sam.doe@example.com",
1179
+ "name": "Sam Doe"
1129
1180
  }
1130
1181
  ],
1131
- "batch_id": "[YOUR BATCH ID GOES HERE]",
1132
- "categories": [
1133
- "category1",
1134
- "category2"
1135
- ],
1136
- "content": [
1182
+ "cc": [
1137
1183
  {
1138
- "type": "text/html",
1139
- "value": "<html><p>Hello, world!</p><img src=[CID GOES HERE]></img></html>"
1184
+ "email": "jane.doe@example.com",
1185
+ "name": "Jane Doe"
1140
1186
  }
1141
1187
  ],
1142
1188
  "custom_args": {
@@ -1144,1573 +1190,1526 @@ class TestAPI < MiniTest::Test
1144
1190
  "activationAttempt": "1",
1145
1191
  "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]"
1146
1192
  },
1147
- "from": {
1148
- "email": "sam.smith@example.com",
1149
- "name": "Sam Smith"
1150
- },
1151
- "headers": {},
1152
- "ip_pool_name": "[YOUR POOL NAME GOES HERE]",
1153
- "mail_settings": {
1154
- "bcc": {
1155
- "email": "ben.doe@example.com",
1156
- "enable": true
1157
- },
1158
- "bypass_list_management": {
1159
- "enable": true
1160
- },
1161
- "footer": {
1162
- "enable": true,
1163
- "html": "<p>Thanks</br>The Twilio SendGrid Team</p>",
1164
- "text": "Thanks,/n The Twilio SendGrid Team"
1165
- },
1166
- "sandbox_mode": {
1167
- "enable": false
1168
- },
1169
- "spam_check": {
1170
- "enable": true,
1171
- "post_to_url": "http://example.com/compliance",
1172
- "threshold": 3
1173
- }
1174
- },
1175
- "personalizations": [
1176
- {
1177
- "bcc": [
1178
- {
1179
- "email": "sam.doe@example.com",
1180
- "name": "Sam Doe"
1181
- }
1182
- ],
1183
- "cc": [
1184
- {
1185
- "email": "jane.doe@example.com",
1186
- "name": "Jane Doe"
1187
- }
1188
- ],
1189
- "custom_args": {
1190
- "New Argument 1": "New Value 1",
1191
- "activationAttempt": "1",
1192
- "customerAccountNumber": "[CUSTOMER ACCOUNT NUMBER GOES HERE]"
1193
- },
1194
- "headers": {
1195
- "X-Accept-Language": "en",
1196
- "X-Mailer": "MyApp"
1197
- },
1198
- "send_at": 1409348513,
1199
- "subject": "Hello, World!",
1200
- "substitutions": {
1201
- "id": "substitutions",
1202
- "type": "object"
1203
- },
1204
- "to": [
1205
- {
1206
- "email": "john.doe@example.com",
1207
- "name": "John Doe"
1208
- }
1209
- ]
1210
- }
1211
- ],
1212
- "reply_to": {
1213
- "email": "sam.smith@example.com",
1214
- "name": "Sam Smith"
1215
- },
1216
- "sections": {
1217
- "section": {
1218
- ":sectionName1": "section 1 text",
1219
- ":sectionName2": "section 2 text"
1220
- }
1193
+ "headers": {
1194
+ "X-Accept-Language": "en",
1195
+ "X-Mailer": "MyApp"
1221
1196
  },
1222
1197
  "send_at": 1409348513,
1223
1198
  "subject": "Hello, World!",
1224
- "template_id": "[YOUR TEMPLATE ID GOES HERE]",
1225
- "tracking_settings": {
1226
- "click_tracking": {
1227
- "enable": true,
1228
- "enable_text": true
1229
- },
1230
- "ganalytics": {
1231
- "enable": true,
1232
- "utm_campaign": "[NAME OF YOUR REFERRER SOURCE]",
1233
- "utm_content": "[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]",
1234
- "utm_medium": "[NAME OF YOUR MARKETING MEDIUM e.g. email]",
1235
- "utm_name": "[NAME OF YOUR CAMPAIGN]",
1236
- "utm_term": "[IDENTIFY PAID KEYWORDS HERE]"
1237
- },
1238
- "open_tracking": {
1239
- "enable": true,
1240
- "substitution_tag": "%opentrack"
1241
- },
1242
- "subscription_tracking": {
1243
- "enable": true,
1244
- "html": "If you would like to unsubscribe and stop receiving these emails <% clickhere %>.",
1245
- "substitution_tag": "<%click here%>",
1246
- "text": "If you would like to unsubscribe and stop receiveing these emails <% click here %>."
1199
+ "substitutions": {
1200
+ "id": "substitutions",
1201
+ "type": "object"
1202
+ },
1203
+ "to": [
1204
+ {
1205
+ "email": "john.doe@example.com",
1206
+ "name": "John Doe"
1247
1207
  }
1248
- }
1249
- }')
1250
- headers = JSON.parse('{"X-Mock": 202}')
1251
-
1252
- response = @sg.client.mail._("send").post(request_body: data, request_headers: headers)
1208
+ ]
1209
+ }
1210
+ ],
1211
+ "reply_to": {
1212
+ "email": "sam.smith@example.com",
1213
+ "name": "Sam Smith"
1214
+ },
1215
+ "sections": {
1216
+ "section": {
1217
+ ":sectionName1": "section 1 text",
1218
+ ":sectionName2": "section 2 text"
1219
+ }
1220
+ },
1221
+ "send_at": 1409348513,
1222
+ "subject": "Hello, World!",
1223
+ "template_id": "[YOUR TEMPLATE ID GOES HERE]",
1224
+ "tracking_settings": {
1225
+ "click_tracking": {
1226
+ "enable": true,
1227
+ "enable_text": true
1228
+ },
1229
+ "ganalytics": {
1230
+ "enable": true,
1231
+ "utm_campaign": "[NAME OF YOUR REFERRER SOURCE]",
1232
+ "utm_content": "[USE THIS SPACE TO DIFFERENTIATE YOUR EMAIL FROM ADS]",
1233
+ "utm_medium": "[NAME OF YOUR MARKETING MEDIUM e.g. email]",
1234
+ "utm_name": "[NAME OF YOUR CAMPAIGN]",
1235
+ "utm_term": "[IDENTIFY PAID KEYWORDS HERE]"
1236
+ },
1237
+ "open_tracking": {
1238
+ "enable": true,
1239
+ "substitution_tag": "%opentrack"
1240
+ },
1241
+ "subscription_tracking": {
1242
+ "enable": true,
1243
+ "html": "If you would like to unsubscribe and stop receiving these emails <% clickhere %>.",
1244
+ "substitution_tag": "<%click here%>",
1245
+ "text": "If you would like to unsubscribe and stop receiveing these emails <% click here %>."
1246
+ }
1247
+ }
1248
+ }')
1249
+ headers = JSON.parse('{"X-Mock": 202}')
1253
1250
 
1254
- self.assert_equal('202', response.status_code)
1255
- end
1251
+ response = @sg.client.mail._('send').post(request_body: data, request_headers: headers)
1252
+
1253
+ assert_equal('202', response.status_code)
1254
+ end
1256
1255
 
1257
- def test_mail_settings_get
1258
- params = JSON.parse('{"limit": 1, "offset": 1}')
1259
- headers = JSON.parse('{"X-Mock": 200}')
1256
+ def test_mail_settings_get
1257
+ params = JSON.parse('{"limit": 1, "offset": 1}')
1258
+ headers = JSON.parse('{"X-Mock": 200}')
1260
1259
 
1261
- response = @sg.client.mail_settings.get(query_params: params, request_headers: headers)
1260
+ response = @sg.client.mail_settings.get(query_params: params, request_headers: headers)
1262
1261
 
1263
- self.assert_equal('200', response.status_code)
1264
- end
1262
+ assert_equal('200', response.status_code)
1263
+ end
1265
1264
 
1266
- def test_mail_settings_address_whitelist_patch
1267
- data = JSON.parse('{
1268
- "enabled": true,
1269
- "list": [
1270
- "email1@example.com",
1271
- "example.com"
1272
- ]
1265
+ def test_mail_settings_address_whitelist_patch
1266
+ data = JSON.parse('{
1267
+ "enabled": true,
1268
+ "list": [
1269
+ "email1@example.com",
1270
+ "example.com"
1271
+ ]
1273
1272
  }')
1274
- headers = JSON.parse('{"X-Mock": 200}')
1273
+ headers = JSON.parse('{"X-Mock": 200}')
1275
1274
 
1276
- response = @sg.client.mail_settings.address_whitelist.patch(request_body: data, request_headers: headers)
1275
+ response = @sg.client.mail_settings.address_whitelist.patch(request_body: data, request_headers: headers)
1277
1276
 
1278
- self.assert_equal('200', response.status_code)
1279
- end
1277
+ assert_equal('200', response.status_code)
1278
+ end
1280
1279
 
1281
- def test_mail_settings_address_whitelist_get
1282
- headers = JSON.parse('{"X-Mock": 200}')
1280
+ def test_mail_settings_address_whitelist_get
1281
+ headers = JSON.parse('{"X-Mock": 200}')
1283
1282
 
1284
- response = @sg.client.mail_settings.address_whitelist.get(request_headers: headers)
1283
+ response = @sg.client.mail_settings.address_whitelist.get(request_headers: headers)
1285
1284
 
1286
- self.assert_equal('200', response.status_code)
1287
- end
1285
+ assert_equal('200', response.status_code)
1286
+ end
1288
1287
 
1289
- def test_mail_settings_bcc_patch
1290
- data = JSON.parse('{
1291
- "email": "email@example.com",
1292
- "enabled": false
1288
+ def test_mail_settings_bcc_patch
1289
+ data = JSON.parse('{
1290
+ "email": "email@example.com",
1291
+ "enabled": false
1293
1292
  }')
1294
- headers = JSON.parse('{"X-Mock": 200}')
1293
+ headers = JSON.parse('{"X-Mock": 200}')
1295
1294
 
1296
- response = @sg.client.mail_settings.bcc.patch(request_body: data, request_headers: headers)
1295
+ response = @sg.client.mail_settings.bcc.patch(request_body: data, request_headers: headers)
1297
1296
 
1298
- self.assert_equal('200', response.status_code)
1299
- end
1297
+ assert_equal('200', response.status_code)
1298
+ end
1300
1299
 
1301
- def test_mail_settings_bcc_get
1302
- headers = JSON.parse('{"X-Mock": 200}')
1300
+ def test_mail_settings_bcc_get
1301
+ headers = JSON.parse('{"X-Mock": 200}')
1303
1302
 
1304
- response = @sg.client.mail_settings.bcc.get(request_headers: headers)
1303
+ response = @sg.client.mail_settings.bcc.get(request_headers: headers)
1305
1304
 
1306
- self.assert_equal('200', response.status_code)
1307
- end
1305
+ assert_equal('200', response.status_code)
1306
+ end
1308
1307
 
1309
- def test_mail_settings_bounce_purge_patch
1310
- data = JSON.parse('{
1311
- "enabled": true,
1312
- "hard_bounces": 5,
1313
- "soft_bounces": 5
1308
+ def test_mail_settings_bounce_purge_patch
1309
+ data = JSON.parse('{
1310
+ "enabled": true,
1311
+ "hard_bounces": 5,
1312
+ "soft_bounces": 5
1314
1313
  }')
1315
- headers = JSON.parse('{"X-Mock": 200}')
1314
+ headers = JSON.parse('{"X-Mock": 200}')
1316
1315
 
1317
- response = @sg.client.mail_settings.bounce_purge.patch(request_body: data, request_headers: headers)
1316
+ response = @sg.client.mail_settings.bounce_purge.patch(request_body: data, request_headers: headers)
1318
1317
 
1319
- self.assert_equal('200', response.status_code)
1320
- end
1318
+ assert_equal('200', response.status_code)
1319
+ end
1321
1320
 
1322
- def test_mail_settings_bounce_purge_get
1323
- headers = JSON.parse('{"X-Mock": 200}')
1321
+ def test_mail_settings_bounce_purge_get
1322
+ headers = JSON.parse('{"X-Mock": 200}')
1324
1323
 
1325
- response = @sg.client.mail_settings.bounce_purge.get(request_headers: headers)
1324
+ response = @sg.client.mail_settings.bounce_purge.get(request_headers: headers)
1326
1325
 
1327
- self.assert_equal('200', response.status_code)
1328
- end
1326
+ assert_equal('200', response.status_code)
1327
+ end
1329
1328
 
1330
- def test_mail_settings_footer_patch
1331
- data = JSON.parse('{
1332
- "enabled": true,
1333
- "html_content": "...",
1334
- "plain_content": "..."
1329
+ def test_mail_settings_footer_patch
1330
+ data = JSON.parse('{
1331
+ "enabled": true,
1332
+ "html_content": "...",
1333
+ "plain_content": "..."
1335
1334
  }')
1336
- headers = JSON.parse('{"X-Mock": 200}')
1335
+ headers = JSON.parse('{"X-Mock": 200}')
1337
1336
 
1338
- response = @sg.client.mail_settings.footer.patch(request_body: data, request_headers: headers)
1337
+ response = @sg.client.mail_settings.footer.patch(request_body: data, request_headers: headers)
1339
1338
 
1340
- self.assert_equal('200', response.status_code)
1341
- end
1339
+ assert_equal('200', response.status_code)
1340
+ end
1342
1341
 
1343
- def test_mail_settings_footer_get
1344
- headers = JSON.parse('{"X-Mock": 200}')
1342
+ def test_mail_settings_footer_get
1343
+ headers = JSON.parse('{"X-Mock": 200}')
1345
1344
 
1346
- response = @sg.client.mail_settings.footer.get(request_headers: headers)
1345
+ response = @sg.client.mail_settings.footer.get(request_headers: headers)
1347
1346
 
1348
- self.assert_equal('200', response.status_code)
1349
- end
1347
+ assert_equal('200', response.status_code)
1348
+ end
1350
1349
 
1351
- def test_mail_settings_forward_bounce_patch
1352
- data = JSON.parse('{
1353
- "email": "example@example.com",
1354
- "enabled": true
1350
+ def test_mail_settings_forward_bounce_patch
1351
+ data = JSON.parse('{
1352
+ "email": "example@example.com",
1353
+ "enabled": true
1355
1354
  }')
1356
- headers = JSON.parse('{"X-Mock": 200}')
1355
+ headers = JSON.parse('{"X-Mock": 200}')
1357
1356
 
1358
- response = @sg.client.mail_settings.forward_bounce.patch(request_body: data, request_headers: headers)
1357
+ response = @sg.client.mail_settings.forward_bounce.patch(request_body: data, request_headers: headers)
1359
1358
 
1360
- self.assert_equal('200', response.status_code)
1361
- end
1359
+ assert_equal('200', response.status_code)
1360
+ end
1362
1361
 
1363
- def test_mail_settings_forward_bounce_get
1364
- headers = JSON.parse('{"X-Mock": 200}')
1362
+ def test_mail_settings_forward_bounce_get
1363
+ headers = JSON.parse('{"X-Mock": 200}')
1365
1364
 
1366
- response = @sg.client.mail_settings.forward_bounce.get(request_headers: headers)
1365
+ response = @sg.client.mail_settings.forward_bounce.get(request_headers: headers)
1367
1366
 
1368
- self.assert_equal('200', response.status_code)
1369
- end
1367
+ assert_equal('200', response.status_code)
1368
+ end
1370
1369
 
1371
- def test_mail_settings_forward_spam_patch
1372
- data = JSON.parse('{
1373
- "email": "",
1374
- "enabled": false
1370
+ def test_mail_settings_forward_spam_patch
1371
+ data = JSON.parse('{
1372
+ "email": "",
1373
+ "enabled": false
1375
1374
  }')
1376
- headers = JSON.parse('{"X-Mock": 200}')
1375
+ headers = JSON.parse('{"X-Mock": 200}')
1377
1376
 
1378
- response = @sg.client.mail_settings.forward_spam.patch(request_body: data, request_headers: headers)
1377
+ response = @sg.client.mail_settings.forward_spam.patch(request_body: data, request_headers: headers)
1379
1378
 
1380
- self.assert_equal('200', response.status_code)
1381
- end
1379
+ assert_equal('200', response.status_code)
1380
+ end
1382
1381
 
1383
- def test_mail_settings_forward_spam_get
1384
- headers = JSON.parse('{"X-Mock": 200}')
1382
+ def test_mail_settings_forward_spam_get
1383
+ headers = JSON.parse('{"X-Mock": 200}')
1385
1384
 
1386
- response = @sg.client.mail_settings.forward_spam.get(request_headers: headers)
1385
+ response = @sg.client.mail_settings.forward_spam.get(request_headers: headers)
1387
1386
 
1388
- self.assert_equal('200', response.status_code)
1389
- end
1387
+ assert_equal('200', response.status_code)
1388
+ end
1390
1389
 
1391
- def test_mail_settings_plain_content_patch
1392
- data = JSON.parse('{
1393
- "enabled": false
1390
+ def test_mail_settings_plain_content_patch
1391
+ data = JSON.parse('{
1392
+ "enabled": false
1394
1393
  }')
1395
- headers = JSON.parse('{"X-Mock": 200}')
1394
+ headers = JSON.parse('{"X-Mock": 200}')
1396
1395
 
1397
- response = @sg.client.mail_settings.plain_content.patch(request_body: data, request_headers: headers)
1396
+ response = @sg.client.mail_settings.plain_content.patch(request_body: data, request_headers: headers)
1398
1397
 
1399
- self.assert_equal('200', response.status_code)
1400
- end
1398
+ assert_equal('200', response.status_code)
1399
+ end
1401
1400
 
1402
- def test_mail_settings_plain_content_get
1403
- headers = JSON.parse('{"X-Mock": 200}')
1401
+ def test_mail_settings_plain_content_get
1402
+ headers = JSON.parse('{"X-Mock": 200}')
1404
1403
 
1405
- response = @sg.client.mail_settings.plain_content.get(request_headers: headers)
1404
+ response = @sg.client.mail_settings.plain_content.get(request_headers: headers)
1406
1405
 
1407
- self.assert_equal('200', response.status_code)
1408
- end
1406
+ assert_equal('200', response.status_code)
1407
+ end
1409
1408
 
1410
- def test_mail_settings_spam_check_patch
1411
- data = JSON.parse('{
1412
- "enabled": true,
1413
- "max_score": 5,
1414
- "url": "url"
1409
+ def test_mail_settings_spam_check_patch
1410
+ data = JSON.parse('{
1411
+ "enabled": true,
1412
+ "max_score": 5,
1413
+ "url": "url"
1415
1414
  }')
1416
- headers = JSON.parse('{"X-Mock": 200}')
1415
+ headers = JSON.parse('{"X-Mock": 200}')
1417
1416
 
1418
- response = @sg.client.mail_settings.spam_check.patch(request_body: data, request_headers: headers)
1417
+ response = @sg.client.mail_settings.spam_check.patch(request_body: data, request_headers: headers)
1419
1418
 
1420
- self.assert_equal('200', response.status_code)
1421
- end
1419
+ assert_equal('200', response.status_code)
1420
+ end
1422
1421
 
1423
- def test_mail_settings_spam_check_get
1424
- headers = JSON.parse('{"X-Mock": 200}')
1422
+ def test_mail_settings_spam_check_get
1423
+ headers = JSON.parse('{"X-Mock": 200}')
1425
1424
 
1426
- response = @sg.client.mail_settings.spam_check.get(request_headers: headers)
1425
+ response = @sg.client.mail_settings.spam_check.get(request_headers: headers)
1427
1426
 
1428
- self.assert_equal('200', response.status_code)
1429
- end
1427
+ assert_equal('200', response.status_code)
1428
+ end
1430
1429
 
1431
- def test_mail_settings_template_patch
1432
- data = JSON.parse('{
1433
- "enabled": true,
1434
- "html_content": "<% body %>"
1430
+ def test_mail_settings_template_patch
1431
+ data = JSON.parse('{
1432
+ "enabled": true,
1433
+ "html_content": "<% body %>"
1435
1434
  }')
1436
- headers = JSON.parse('{"X-Mock": 200}')
1435
+ headers = JSON.parse('{"X-Mock": 200}')
1437
1436
 
1438
- response = @sg.client.mail_settings.template.patch(request_body: data, request_headers: headers)
1437
+ response = @sg.client.mail_settings.template.patch(request_body: data, request_headers: headers)
1439
1438
 
1440
- self.assert_equal('200', response.status_code)
1441
- end
1439
+ assert_equal('200', response.status_code)
1440
+ end
1442
1441
 
1443
- def test_mail_settings_template_get
1444
- headers = JSON.parse('{"X-Mock": 200}')
1442
+ def test_mail_settings_template_get
1443
+ headers = JSON.parse('{"X-Mock": 200}')
1445
1444
 
1446
- response = @sg.client.mail_settings.template.get(request_headers: headers)
1445
+ response = @sg.client.mail_settings.template.get(request_headers: headers)
1447
1446
 
1448
- self.assert_equal('200', response.status_code)
1449
- end
1447
+ assert_equal('200', response.status_code)
1448
+ end
1450
1449
 
1451
- def test_mailbox_providers_stats_get
1452
- params = JSON.parse('{"end_date": "2016-04-01", "mailbox_providers": "test_string", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}')
1453
- headers = JSON.parse('{"X-Mock": 200}')
1450
+ def test_mailbox_providers_stats_get
1451
+ params = JSON.parse('{"end_date": "2016-04-01", "mailbox_providers": "test_string", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}')
1452
+ headers = JSON.parse('{"X-Mock": 200}')
1454
1453
 
1455
- response = @sg.client.mailbox_providers.stats.get(query_params: params, request_headers: headers)
1454
+ response = @sg.client.mailbox_providers.stats.get(query_params: params, request_headers: headers)
1456
1455
 
1457
- self.assert_equal('200', response.status_code)
1458
- end
1456
+ assert_equal('200', response.status_code)
1457
+ end
1459
1458
 
1460
- def test_partner_settings_get
1461
- params = JSON.parse('{"limit": 1, "offset": 1}')
1462
- headers = JSON.parse('{"X-Mock": 200}')
1459
+ def test_partner_settings_get
1460
+ params = JSON.parse('{"limit": 1, "offset": 1}')
1461
+ headers = JSON.parse('{"X-Mock": 200}')
1463
1462
 
1464
- response = @sg.client.partner_settings.get(query_params: params, request_headers: headers)
1463
+ response = @sg.client.partner_settings.get(query_params: params, request_headers: headers)
1465
1464
 
1466
- self.assert_equal('200', response.status_code)
1467
- end
1465
+ assert_equal('200', response.status_code)
1466
+ end
1468
1467
 
1469
- def test_partner_settings_new_relic_patch
1470
- data = JSON.parse('{
1471
- "enable_subuser_statistics": true,
1472
- "enabled": true,
1473
- "license_key": ""
1468
+ def test_partner_settings_new_relic_patch
1469
+ data = JSON.parse('{
1470
+ "enable_subuser_statistics": true,
1471
+ "enabled": true,
1472
+ "license_key": ""
1474
1473
  }')
1475
- headers = JSON.parse('{"X-Mock": 200}')
1476
-
1477
- response = @sg.client.partner_settings.new_relic.patch(request_body: data, request_headers: headers)
1474
+ headers = JSON.parse('{"X-Mock": 200}')
1478
1475
 
1479
- self.assert_equal('200', response.status_code)
1480
- end
1476
+ response = @sg.client.partner_settings.new_relic.patch(request_body: data, request_headers: headers)
1481
1477
 
1482
- def test_partner_settings_new_relic_get
1483
- headers = JSON.parse('{"X-Mock": 200}')
1478
+ assert_equal('200', response.status_code)
1479
+ end
1484
1480
 
1485
- response = @sg.client.partner_settings.new_relic.get(request_headers: headers)
1481
+ def test_partner_settings_new_relic_get
1482
+ headers = JSON.parse('{"X-Mock": 200}')
1486
1483
 
1487
- self.assert_equal('200', response.status_code)
1488
- end
1484
+ response = @sg.client.partner_settings.new_relic.get(request_headers: headers)
1489
1485
 
1490
- def test_scopes_get
1491
- headers = JSON.parse('{"X-Mock": 200}')
1486
+ assert_equal('200', response.status_code)
1487
+ end
1488
+
1489
+ def test_scopes_get
1490
+ headers = JSON.parse('{"X-Mock": 200}')
1492
1491
 
1493
- response = @sg.client.scopes.get(request_headers: headers)
1492
+ response = @sg.client.scopes.get(request_headers: headers)
1494
1493
 
1495
- self.assert_equal('200', response.status_code)
1496
- end
1494
+ assert_equal('200', response.status_code)
1495
+ end
1497
1496
 
1498
- def test_senders_post
1499
- data = JSON.parse('{
1500
- "address": "123 Elm St.",
1501
- "address_2": "Apt. 456",
1502
- "city": "Denver",
1503
- "country": "United States",
1504
- "from": {
1505
- "email": "from@example.com",
1506
- "name": "Example INC"
1507
- },
1508
- "nickname": "My Sender ID",
1509
- "reply_to": {
1510
- "email": "replyto@example.com",
1511
- "name": "Example INC"
1512
- },
1513
- "state": "Colorado",
1514
- "zip": "80202"
1515
- }')
1516
- headers = JSON.parse('{"X-Mock": 201}')
1517
- response = @sg.client.senders.post(request_body: data, request_headers: headers)
1518
- self.assert_equal(response.status_code, "201")
1519
- end
1520
-
1521
- def test_senders_get
1522
- headers = JSON.parse('{"X-Mock": 200}')
1523
- response = @sg.client.senders.get(request_headers: headers)
1524
- self.assert_equal(response.status_code, "200")
1525
- end
1526
-
1527
- def test_senders__sender_id__patch
1528
- data = JSON.parse('{
1529
- "address": "123 Elm St.",
1530
- "address_2": "Apt. 456",
1531
- "city": "Denver",
1532
- "country": "United States",
1533
- "from": {
1534
- "email": "from@example.com",
1535
- "name": "Example INC"
1536
- },
1537
- "nickname": "My Sender ID",
1538
- "reply_to": {
1539
- "email": "replyto@example.com",
1540
- "name": "Example INC"
1541
- },
1542
- "state": "Colorado",
1543
- "zip": "80202"
1544
- }')
1545
- sender_id = "test_url_param"
1546
- headers = JSON.parse('{"X-Mock": 200}')
1547
- response = @sg.client.senders._(sender_id).patch(request_body: data, request_headers: headers)
1548
- self.assert_equal(response.status_code, "200")
1549
- end
1550
-
1551
- def test_senders__sender_id__get
1552
- sender_id = "test_url_param"
1553
- headers = JSON.parse('{"X-Mock": 200}')
1554
- response = @sg.client.senders._(sender_id).get(request_headers: headers)
1555
- self.assert_equal(response.status_code, "200")
1556
- end
1557
-
1558
- def test_senders__sender_id__delete
1559
- sender_id = "test_url_param"
1560
- headers = JSON.parse('{"X-Mock": 204}')
1561
- response = @sg.client.senders._(sender_id).delete(request_headers: headers)
1562
- self.assert_equal(response.status_code, "204")
1563
- end
1564
-
1565
- def test_senders__sender_id__resend_verification_post
1566
- sender_id = "test_url_param"
1567
- headers = JSON.parse('{"X-Mock": 204}')
1568
- response = @sg.client.senders._(sender_id).resend_verification.post(request_headers: headers)
1569
- self.assert_equal(response.status_code, "204")
1570
- end
1571
-
1572
- def test_stats_get
1573
- params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}')
1574
- headers = JSON.parse('{"X-Mock": 200}')
1575
-
1576
- response = @sg.client.stats.get(query_params: params, request_headers: headers)
1577
-
1578
- self.assert_equal('200', response.status_code)
1579
- end
1580
-
1581
- def test_subusers_post
1582
- data = JSON.parse('{
1583
- "email": "John@example.com",
1584
- "ips": [
1585
- "1.1.1.1",
1586
- "2.2.2.2"
1587
- ],
1588
- "password": "johns_password",
1589
- "username": "John@example.com"
1497
+ def test_senders_post
1498
+ data = JSON.parse('{
1499
+ "address": "123 Elm St.",
1500
+ "address_2": "Apt. 456",
1501
+ "city": "Denver",
1502
+ "country": "United States",
1503
+ "from": {
1504
+ "email": "from@example.com",
1505
+ "name": "Example INC"
1506
+ },
1507
+ "nickname": "My Sender ID",
1508
+ "reply_to": {
1509
+ "email": "replyto@example.com",
1510
+ "name": "Example INC"
1511
+ },
1512
+ "state": "Colorado",
1513
+ "zip": "80202"
1590
1514
  }')
1591
- headers = JSON.parse('{"X-Mock": 200}')
1592
-
1593
- response = @sg.client.subusers.post(request_body: data, request_headers: headers)
1594
-
1595
- self.assert_equal('200', response.status_code)
1596
- end
1597
-
1598
- def test_subusers_get
1599
- params = JSON.parse('{"username": "test_string", "limit": 1, "offset": 1}')
1600
- headers = JSON.parse('{"X-Mock": 200}')
1601
-
1602
- response = @sg.client.subusers.get(query_params: params, request_headers: headers)
1603
-
1604
- self.assert_equal('200', response.status_code)
1605
- end
1606
-
1607
- def test_subusers_reputations_get
1608
- params = JSON.parse('{"usernames": "test_string"}')
1609
- headers = JSON.parse('{"X-Mock": 200}')
1610
-
1611
- response = @sg.client.subusers.reputations.get(query_params: params, request_headers: headers)
1612
-
1613
- self.assert_equal('200', response.status_code)
1614
- end
1515
+ headers = JSON.parse('{"X-Mock": 201}')
1516
+ response = @sg.client.senders.post(request_body: data, request_headers: headers)
1517
+ assert_equal(response.status_code, '201')
1518
+ end
1519
+
1520
+ def test_senders_get
1521
+ headers = JSON.parse('{"X-Mock": 200}')
1522
+ response = @sg.client.senders.get(request_headers: headers)
1523
+ assert_equal(response.status_code, '200')
1524
+ end
1525
+
1526
+ def test_senders__sender_id__patch
1527
+ data = JSON.parse('{
1528
+ "address": "123 Elm St.",
1529
+ "address_2": "Apt. 456",
1530
+ "city": "Denver",
1531
+ "country": "United States",
1532
+ "from": {
1533
+ "email": "from@example.com",
1534
+ "name": "Example INC"
1535
+ },
1536
+ "nickname": "My Sender ID",
1537
+ "reply_to": {
1538
+ "email": "replyto@example.com",
1539
+ "name": "Example INC"
1540
+ },
1541
+ "state": "Colorado",
1542
+ "zip": "80202"
1543
+ }')
1544
+ sender_id = 'test_url_param'
1545
+ headers = JSON.parse('{"X-Mock": 200}')
1546
+ response = @sg.client.senders._(sender_id).patch(request_body: data, request_headers: headers)
1547
+ assert_equal(response.status_code, '200')
1548
+ end
1549
+
1550
+ def test_senders__sender_id__get
1551
+ sender_id = 'test_url_param'
1552
+ headers = JSON.parse('{"X-Mock": 200}')
1553
+ response = @sg.client.senders._(sender_id).get(request_headers: headers)
1554
+ assert_equal(response.status_code, '200')
1555
+ end
1556
+
1557
+ def test_senders__sender_id__delete
1558
+ sender_id = 'test_url_param'
1559
+ headers = JSON.parse('{"X-Mock": 204}')
1560
+ response = @sg.client.senders._(sender_id).delete(request_headers: headers)
1561
+ assert_equal(response.status_code, '204')
1562
+ end
1563
+
1564
+ def test_senders__sender_id__resend_verification_post
1565
+ sender_id = 'test_url_param'
1566
+ headers = JSON.parse('{"X-Mock": 204}')
1567
+ response = @sg.client.senders._(sender_id).resend_verification.post(request_headers: headers)
1568
+ assert_equal(response.status_code, '204')
1569
+ end
1570
+
1571
+ def test_stats_get
1572
+ params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}')
1573
+ headers = JSON.parse('{"X-Mock": 200}')
1574
+
1575
+ response = @sg.client.stats.get(query_params: params, request_headers: headers)
1576
+
1577
+ assert_equal('200', response.status_code)
1578
+ end
1579
+
1580
+ def test_subusers_post
1581
+ data = JSON.parse('{
1582
+ "email": "John@example.com",
1583
+ "ips": [
1584
+ "1.1.1.1",
1585
+ "2.2.2.2"
1586
+ ],
1587
+ "password": "johns_password",
1588
+ "username": "John@example.com"
1589
+ }')
1590
+ headers = JSON.parse('{"X-Mock": 200}')
1591
+
1592
+ response = @sg.client.subusers.post(request_body: data, request_headers: headers)
1593
+
1594
+ assert_equal('200', response.status_code)
1595
+ end
1596
+
1597
+ def test_subusers_get
1598
+ params = JSON.parse('{"username": "test_string", "limit": 1, "offset": 1}')
1599
+ headers = JSON.parse('{"X-Mock": 200}')
1600
+
1601
+ response = @sg.client.subusers.get(query_params: params, request_headers: headers)
1602
+
1603
+ assert_equal('200', response.status_code)
1604
+ end
1605
+
1606
+ def test_subusers_reputations_get
1607
+ params = JSON.parse('{"usernames": "test_string"}')
1608
+ headers = JSON.parse('{"X-Mock": 200}')
1609
+
1610
+ response = @sg.client.subusers.reputations.get(query_params: params, request_headers: headers)
1611
+
1612
+ assert_equal('200', response.status_code)
1613
+ end
1614
+
1615
+ def test_subusers_stats_get
1616
+ params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}')
1617
+ headers = JSON.parse('{"X-Mock": 200}')
1618
+
1619
+ response = @sg.client.subusers.stats.get(query_params: params, request_headers: headers)
1620
+
1621
+ assert_equal('200', response.status_code)
1622
+ end
1615
1623
 
1616
- def test_subusers_stats_get
1617
- params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}')
1618
- headers = JSON.parse('{"X-Mock": 200}')
1624
+ def test_subusers_stats_monthly_get
1625
+ params = JSON.parse('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}')
1626
+ headers = JSON.parse('{"X-Mock": 200}')
1619
1627
 
1620
- response = @sg.client.subusers.stats.get(query_params: params, request_headers: headers)
1628
+ response = @sg.client.subusers.stats.monthly.get(query_params: params, request_headers: headers)
1621
1629
 
1622
- self.assert_equal('200', response.status_code)
1623
- end
1630
+ assert_equal('200', response.status_code)
1631
+ end
1624
1632
 
1625
- def test_subusers_stats_monthly_get
1626
- params = JSON.parse('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}')
1627
- headers = JSON.parse('{"X-Mock": 200}')
1633
+ def test_subusers_stats_sums_get
1634
+ params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}')
1635
+ headers = JSON.parse('{"X-Mock": 200}')
1628
1636
 
1629
- response = @sg.client.subusers.stats.monthly.get(query_params: params, request_headers: headers)
1637
+ response = @sg.client.subusers.stats.sums.get(query_params: params, request_headers: headers)
1630
1638
 
1631
- self.assert_equal('200', response.status_code)
1632
- end
1639
+ assert_equal('200', response.status_code)
1640
+ end
1633
1641
 
1634
- def test_subusers_stats_sums_get
1635
- params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}')
1636
- headers = JSON.parse('{"X-Mock": 200}')
1637
-
1638
- response = @sg.client.subusers.stats.sums.get(query_params: params, request_headers: headers)
1639
-
1640
- self.assert_equal('200', response.status_code)
1641
- end
1642
-
1643
- def test_subusers__subuser_name__patch
1644
- data = JSON.parse('{
1645
- "disabled": false
1642
+ def test_subusers__subuser_name__patch
1643
+ data = JSON.parse('{
1644
+ "disabled": false
1646
1645
  }')
1647
- subuser_name = "test_url_param"
1648
- headers = JSON.parse('{"X-Mock": 204}')
1646
+ subuser_name = 'test_url_param'
1647
+ headers = JSON.parse('{"X-Mock": 204}')
1649
1648
 
1650
- response = @sg.client.subusers._(subuser_name).patch(request_body: data, request_headers: headers)
1649
+ response = @sg.client.subusers._(subuser_name).patch(request_body: data, request_headers: headers)
1651
1650
 
1652
- self.assert_equal('204', response.status_code)
1653
- end
1651
+ assert_equal('204', response.status_code)
1652
+ end
1654
1653
 
1655
- def test_subusers__subuser_name__delete
1656
- subuser_name = "test_url_param"
1657
- headers = JSON.parse('{"X-Mock": 204}')
1654
+ def test_subusers__subuser_name__delete
1655
+ subuser_name = 'test_url_param'
1656
+ headers = JSON.parse('{"X-Mock": 204}')
1658
1657
 
1659
- response = @sg.client.subusers._(subuser_name).delete(request_headers: headers)
1658
+ response = @sg.client.subusers._(subuser_name).delete(request_headers: headers)
1660
1659
 
1661
- self.assert_equal('204', response.status_code)
1662
- end
1660
+ assert_equal('204', response.status_code)
1661
+ end
1663
1662
 
1664
- def test_subusers__subuser_name__ips_put
1665
- data = JSON.parse('[
1666
- "127.0.0.1"
1663
+ def test_subusers__subuser_name__ips_put
1664
+ data = JSON.parse('[
1665
+ "127.0.0.1"
1667
1666
  ]')
1668
- subuser_name = "test_url_param"
1669
- headers = JSON.parse('{"X-Mock": 200}')
1667
+ subuser_name = 'test_url_param'
1668
+ headers = JSON.parse('{"X-Mock": 200}')
1670
1669
 
1671
- response = @sg.client.subusers._(subuser_name).ips.put(request_body: data, request_headers: headers)
1670
+ response = @sg.client.subusers._(subuser_name).ips.put(request_body: data, request_headers: headers)
1672
1671
 
1673
- self.assert_equal('200', response.status_code)
1674
- end
1672
+ assert_equal('200', response.status_code)
1673
+ end
1675
1674
 
1676
- def test_subusers__subuser_name__monitor_put
1677
- data = JSON.parse('{
1678
- "email": "example@example.com",
1679
- "frequency": 500
1675
+ def test_subusers__subuser_name__monitor_put
1676
+ data = JSON.parse('{
1677
+ "email": "example@example.com",
1678
+ "frequency": 500
1680
1679
  }')
1681
- subuser_name = "test_url_param"
1682
- headers = JSON.parse('{"X-Mock": 200}')
1680
+ subuser_name = 'test_url_param'
1681
+ headers = JSON.parse('{"X-Mock": 200}')
1683
1682
 
1684
- response = @sg.client.subusers._(subuser_name).monitor.put(request_body: data, request_headers: headers)
1683
+ response = @sg.client.subusers._(subuser_name).monitor.put(request_body: data, request_headers: headers)
1685
1684
 
1686
- self.assert_equal('200', response.status_code)
1687
- end
1685
+ assert_equal('200', response.status_code)
1686
+ end
1688
1687
 
1689
- def test_subusers__subuser_name__monitor_post
1690
- data = JSON.parse('{
1691
- "email": "example@example.com",
1692
- "frequency": 50000
1688
+ def test_subusers__subuser_name__monitor_post
1689
+ data = JSON.parse('{
1690
+ "email": "example@example.com",
1691
+ "frequency": 50000
1693
1692
  }')
1694
- subuser_name = "test_url_param"
1695
- headers = JSON.parse('{"X-Mock": 200}')
1693
+ subuser_name = 'test_url_param'
1694
+ headers = JSON.parse('{"X-Mock": 200}')
1696
1695
 
1697
- response = @sg.client.subusers._(subuser_name).monitor.post(request_body: data, request_headers: headers)
1696
+ response = @sg.client.subusers._(subuser_name).monitor.post(request_body: data, request_headers: headers)
1698
1697
 
1699
- self.assert_equal('200', response.status_code)
1700
- end
1698
+ assert_equal('200', response.status_code)
1699
+ end
1701
1700
 
1702
- def test_subusers__subuser_name__monitor_get
1703
- subuser_name = "test_url_param"
1704
- headers = JSON.parse('{"X-Mock": 200}')
1701
+ def test_subusers__subuser_name__monitor_get
1702
+ subuser_name = 'test_url_param'
1703
+ headers = JSON.parse('{"X-Mock": 200}')
1705
1704
 
1706
- response = @sg.client.subusers._(subuser_name).monitor.get(request_headers: headers)
1705
+ response = @sg.client.subusers._(subuser_name).monitor.get(request_headers: headers)
1707
1706
 
1708
- self.assert_equal('200', response.status_code)
1709
- end
1707
+ assert_equal('200', response.status_code)
1708
+ end
1710
1709
 
1711
- def test_subusers__subuser_name__monitor_delete
1712
- subuser_name = "test_url_param"
1713
- headers = JSON.parse('{"X-Mock": 204}')
1710
+ def test_subusers__subuser_name__monitor_delete
1711
+ subuser_name = 'test_url_param'
1712
+ headers = JSON.parse('{"X-Mock": 204}')
1714
1713
 
1715
- response = @sg.client.subusers._(subuser_name).monitor.delete(request_headers: headers)
1714
+ response = @sg.client.subusers._(subuser_name).monitor.delete(request_headers: headers)
1716
1715
 
1717
- self.assert_equal('204', response.status_code)
1718
- end
1716
+ assert_equal('204', response.status_code)
1717
+ end
1719
1718
 
1720
- def test_subusers__subuser_name__stats_monthly_get
1721
- params = JSON.parse('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}')
1722
- subuser_name = "test_url_param"
1723
- headers = JSON.parse('{"X-Mock": 200}')
1719
+ def test_subusers__subuser_name__stats_monthly_get
1720
+ params = JSON.parse('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}')
1721
+ subuser_name = 'test_url_param'
1722
+ headers = JSON.parse('{"X-Mock": 200}')
1724
1723
 
1725
- response = @sg.client.subusers._(subuser_name).stats.monthly.get(query_params: params, request_headers: headers)
1724
+ response = @sg.client.subusers._(subuser_name).stats.monthly.get(query_params: params, request_headers: headers)
1726
1725
 
1727
- self.assert_equal('200', response.status_code)
1728
- end
1726
+ assert_equal('200', response.status_code)
1727
+ end
1729
1728
 
1730
- def test_suppression_blocks_get
1731
- params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
1732
- headers = JSON.parse('{"X-Mock": 200}')
1729
+ def test_suppression_blocks_get
1730
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
1731
+ headers = JSON.parse('{"X-Mock": 200}')
1733
1732
 
1734
- response = @sg.client.suppression.blocks.get(query_params: params, request_headers: headers)
1733
+ response = @sg.client.suppression.blocks.get(query_params: params, request_headers: headers)
1735
1734
 
1736
- self.assert_equal('200', response.status_code)
1737
- end
1735
+ assert_equal('200', response.status_code)
1736
+ end
1738
1737
 
1739
- def test_suppression_blocks_delete
1740
- data = JSON.parse('{
1741
- "delete_all": false,
1742
- "emails": [
1743
- "example1@example.com",
1744
- "example2@example.com"
1745
- ]
1738
+ def test_suppression_blocks_delete
1739
+ data = JSON.parse('{
1740
+ "delete_all": false,
1741
+ "emails": [
1742
+ "example1@example.com",
1743
+ "example2@example.com"
1744
+ ]
1746
1745
  }')
1747
- headers = JSON.parse('{"X-Mock": 204}')
1746
+ headers = JSON.parse('{"X-Mock": 204}')
1748
1747
 
1749
- response = @sg.client.suppression.blocks.delete(request_body: data, request_headers: headers)
1748
+ response = @sg.client.suppression.blocks.delete(request_body: data, request_headers: headers)
1750
1749
 
1751
- self.assert_equal('204', response.status_code)
1752
- end
1750
+ assert_equal('204', response.status_code)
1751
+ end
1753
1752
 
1754
- def test_suppression_blocks__email__get
1755
- email = "test_url_param"
1756
- headers = JSON.parse('{"X-Mock": 200}')
1753
+ def test_suppression_blocks__email__get
1754
+ email = 'test_url_param'
1755
+ headers = JSON.parse('{"X-Mock": 200}')
1757
1756
 
1758
- response = @sg.client.suppression.blocks._(email).get(request_headers: headers)
1757
+ response = @sg.client.suppression.blocks._(email).get(request_headers: headers)
1759
1758
 
1760
- self.assert_equal('200', response.status_code)
1761
- end
1759
+ assert_equal('200', response.status_code)
1760
+ end
1762
1761
 
1763
- def test_suppression_blocks__email__delete
1764
- email = "test_url_param"
1765
- headers = JSON.parse('{"X-Mock": 204}')
1762
+ def test_suppression_blocks__email__delete
1763
+ email = 'test_url_param'
1764
+ headers = JSON.parse('{"X-Mock": 204}')
1766
1765
 
1767
- response = @sg.client.suppression.blocks._(email).delete(request_headers: headers)
1766
+ response = @sg.client.suppression.blocks._(email).delete(request_headers: headers)
1768
1767
 
1769
- self.assert_equal('204', response.status_code)
1770
- end
1768
+ assert_equal('204', response.status_code)
1769
+ end
1771
1770
 
1772
- def test_suppression_bounces_get
1773
- params = JSON.parse('{"start_time": 1, "end_time": 1}')
1774
- headers = JSON.parse('{"X-Mock": 200}')
1771
+ def test_suppression_bounces_get
1772
+ params = JSON.parse('{"start_time": 1, "end_time": 1}')
1773
+ headers = JSON.parse('{"X-Mock": 200}')
1775
1774
 
1776
- response = @sg.client.suppression.bounces.get(query_params: params, request_headers: headers)
1775
+ response = @sg.client.suppression.bounces.get(query_params: params, request_headers: headers)
1777
1776
 
1778
- self.assert_equal('200', response.status_code)
1779
- end
1777
+ assert_equal('200', response.status_code)
1778
+ end
1780
1779
 
1781
- def test_suppression_bounces_delete
1782
- data = JSON.parse('{
1783
- "delete_all": true,
1784
- "emails": [
1785
- "example@example.com",
1786
- "example2@example.com"
1787
- ]
1780
+ def test_suppression_bounces_delete
1781
+ data = JSON.parse('{
1782
+ "delete_all": true,
1783
+ "emails": [
1784
+ "example@example.com",
1785
+ "example2@example.com"
1786
+ ]
1788
1787
  }')
1789
- headers = JSON.parse('{"X-Mock": 204}')
1788
+ headers = JSON.parse('{"X-Mock": 204}')
1790
1789
 
1791
- response = @sg.client.suppression.bounces.delete(request_body: data, request_headers: headers)
1790
+ response = @sg.client.suppression.bounces.delete(request_body: data, request_headers: headers)
1792
1791
 
1793
- self.assert_equal('204', response.status_code)
1794
- end
1792
+ assert_equal('204', response.status_code)
1793
+ end
1795
1794
 
1796
- def test_suppression_bounces__email__get
1797
- email = "test_url_param"
1798
- headers = JSON.parse('{"X-Mock": 200}')
1795
+ def test_suppression_bounces__email__get
1796
+ email = 'test_url_param'
1797
+ headers = JSON.parse('{"X-Mock": 200}')
1799
1798
 
1800
- response = @sg.client.suppression.bounces._(email).get(request_headers: headers)
1799
+ response = @sg.client.suppression.bounces._(email).get(request_headers: headers)
1801
1800
 
1802
- self.assert_equal('200', response.status_code)
1803
- end
1801
+ assert_equal('200', response.status_code)
1802
+ end
1804
1803
 
1805
- def test_suppression_bounces__email__delete
1806
- params = JSON.parse('{"email_address": "example@example.com"}')
1807
- email = "test_url_param"
1808
- headers = JSON.parse('{"X-Mock": 204}')
1804
+ def test_suppression_bounces__email__delete
1805
+ params = JSON.parse('{"email_address": "example@example.com"}')
1806
+ email = 'test_url_param'
1807
+ headers = JSON.parse('{"X-Mock": 204}')
1809
1808
 
1810
- response = @sg.client.suppression.bounces._(email).delete(query_params: params, request_headers: headers)
1809
+ response = @sg.client.suppression.bounces._(email).delete(query_params: params, request_headers: headers)
1811
1810
 
1812
- self.assert_equal('204', response.status_code)
1813
- end
1811
+ assert_equal('204', response.status_code)
1812
+ end
1814
1813
 
1815
- def test_suppression_invalid_emails_get
1816
- params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
1817
- headers = JSON.parse('{"X-Mock": 200}')
1814
+ def test_suppression_invalid_emails_get
1815
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
1816
+ headers = JSON.parse('{"X-Mock": 200}')
1818
1817
 
1819
- response = @sg.client.suppression.invalid_emails.get(query_params: params, request_headers: headers)
1818
+ response = @sg.client.suppression.invalid_emails.get(query_params: params, request_headers: headers)
1820
1819
 
1821
- self.assert_equal('200', response.status_code)
1822
- end
1820
+ assert_equal('200', response.status_code)
1821
+ end
1823
1822
 
1824
- def test_suppression_invalid_emails_delete
1825
- data = JSON.parse('{
1826
- "delete_all": false,
1827
- "emails": [
1828
- "example1@example.com",
1829
- "example2@example.com"
1830
- ]
1823
+ def test_suppression_invalid_emails_delete
1824
+ data = JSON.parse('{
1825
+ "delete_all": false,
1826
+ "emails": [
1827
+ "example1@example.com",
1828
+ "example2@example.com"
1829
+ ]
1831
1830
  }')
1832
- headers = JSON.parse('{"X-Mock": 204}')
1831
+ headers = JSON.parse('{"X-Mock": 204}')
1833
1832
 
1834
- response = @sg.client.suppression.invalid_emails.delete(request_body: data, request_headers: headers)
1833
+ response = @sg.client.suppression.invalid_emails.delete(request_body: data, request_headers: headers)
1835
1834
 
1836
- self.assert_equal('204', response.status_code)
1837
- end
1835
+ assert_equal('204', response.status_code)
1836
+ end
1838
1837
 
1839
- def test_suppression_invalid_emails__email__get
1840
- email = "test_url_param"
1841
- headers = JSON.parse('{"X-Mock": 200}')
1838
+ def test_suppression_invalid_emails__email__get
1839
+ email = 'test_url_param'
1840
+ headers = JSON.parse('{"X-Mock": 200}')
1842
1841
 
1843
- response = @sg.client.suppression.invalid_emails._(email).get(request_headers: headers)
1842
+ response = @sg.client.suppression.invalid_emails._(email).get(request_headers: headers)
1844
1843
 
1845
- self.assert_equal('200', response.status_code)
1846
- end
1844
+ assert_equal('200', response.status_code)
1845
+ end
1847
1846
 
1848
- def test_suppression_invalid_emails__email__delete
1849
- email = "test_url_param"
1850
- headers = JSON.parse('{"X-Mock": 204}')
1847
+ def test_suppression_invalid_emails__email__delete
1848
+ email = 'test_url_param'
1849
+ headers = JSON.parse('{"X-Mock": 204}')
1851
1850
 
1852
- response = @sg.client.suppression.invalid_emails._(email).delete(request_headers: headers)
1851
+ response = @sg.client.suppression.invalid_emails._(email).delete(request_headers: headers)
1853
1852
 
1854
- self.assert_equal('204', response.status_code)
1855
- end
1853
+ assert_equal('204', response.status_code)
1854
+ end
1856
1855
 
1857
- def test_suppression_spam_report__email__get
1858
- email = "test_url_param"
1859
- headers = JSON.parse('{"X-Mock": 200}')
1856
+ def test_suppression_spam_report__email__get
1857
+ email = 'test_url_param'
1858
+ headers = JSON.parse('{"X-Mock": 200}')
1860
1859
 
1861
- response = @sg.client.suppression.spam_reports._(email).get(request_headers: headers)
1860
+ response = @sg.client.suppression.spam_reports._(email).get(request_headers: headers)
1862
1861
 
1863
- self.assert_equal('200', response.status_code)
1864
- end
1862
+ assert_equal('200', response.status_code)
1863
+ end
1865
1864
 
1866
- def test_suppression_spam_report__email__delete
1867
- email = "test_url_param"
1868
- headers = JSON.parse('{"X-Mock": 204}')
1865
+ def test_suppression_spam_report__email__delete
1866
+ email = 'test_url_param'
1867
+ headers = JSON.parse('{"X-Mock": 204}')
1869
1868
 
1870
- response = @sg.client.suppression.spam_reports._(email).delete(request_headers: headers)
1869
+ response = @sg.client.suppression.spam_reports._(email).delete(request_headers: headers)
1871
1870
 
1872
- self.assert_equal('204', response.status_code)
1873
- end
1871
+ assert_equal('204', response.status_code)
1872
+ end
1874
1873
 
1875
- def test_suppression_spam_reports_get
1876
- params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
1877
- headers = JSON.parse('{"X-Mock": 200}')
1874
+ def test_suppression_spam_reports_get
1875
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
1876
+ headers = JSON.parse('{"X-Mock": 200}')
1878
1877
 
1879
- response = @sg.client.suppression.spam_reports.get(query_params: params, request_headers: headers)
1878
+ response = @sg.client.suppression.spam_reports.get(query_params: params, request_headers: headers)
1880
1879
 
1881
- self.assert_equal('200', response.status_code)
1882
- end
1880
+ assert_equal('200', response.status_code)
1881
+ end
1883
1882
 
1884
- def test_suppression_spam_reports_delete
1885
- data = JSON.parse('{
1886
- "delete_all": false,
1887
- "emails": [
1888
- "example1@example.com",
1889
- "example2@example.com"
1890
- ]
1883
+ def test_suppression_spam_reports_delete
1884
+ data = JSON.parse('{
1885
+ "delete_all": false,
1886
+ "emails": [
1887
+ "example1@example.com",
1888
+ "example2@example.com"
1889
+ ]
1891
1890
  }')
1892
- headers = JSON.parse('{"X-Mock": 204}')
1891
+ headers = JSON.parse('{"X-Mock": 204}')
1893
1892
 
1894
- response = @sg.client.suppression.spam_reports.delete(request_body: data, request_headers: headers)
1893
+ response = @sg.client.suppression.spam_reports.delete(request_body: data, request_headers: headers)
1895
1894
 
1896
- self.assert_equal('204', response.status_code)
1897
- end
1895
+ assert_equal('204', response.status_code)
1896
+ end
1898
1897
 
1899
- def test_suppression_unsubscribes_get
1900
- params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
1901
- headers = JSON.parse('{"X-Mock": 200}')
1898
+ def test_suppression_unsubscribes_get
1899
+ params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
1900
+ headers = JSON.parse('{"X-Mock": 200}')
1902
1901
 
1903
- response = @sg.client.suppression.unsubscribes.get(query_params: params, request_headers: headers)
1902
+ response = @sg.client.suppression.unsubscribes.get(query_params: params, request_headers: headers)
1904
1903
 
1905
- self.assert_equal('200', response.status_code)
1906
- end
1904
+ assert_equal('200', response.status_code)
1905
+ end
1907
1906
 
1908
- def test_templates_post
1909
- data = JSON.parse('{
1910
- "name": "example_name"
1907
+ def test_templates_post
1908
+ data = JSON.parse('{
1909
+ "name": "example_name"
1911
1910
  }')
1912
- headers = JSON.parse('{"X-Mock": 201}')
1911
+ headers = JSON.parse('{"X-Mock": 201}')
1913
1912
 
1914
- response = @sg.client.templates.post(request_body: data, request_headers: headers)
1913
+ response = @sg.client.templates.post(request_body: data, request_headers: headers)
1915
1914
 
1916
- self.assert_equal('201', response.status_code)
1917
- end
1915
+ assert_equal('201', response.status_code)
1916
+ end
1918
1917
 
1919
- def test_templates_get
1920
- headers = JSON.parse('{"X-Mock": 200}')
1918
+ def test_templates_get
1919
+ headers = JSON.parse('{"X-Mock": 200}')
1921
1920
 
1922
- response = @sg.client.templates.get(request_headers: headers)
1921
+ response = @sg.client.templates.get(request_headers: headers)
1923
1922
 
1924
- self.assert_equal('200', response.status_code)
1925
- end
1923
+ assert_equal('200', response.status_code)
1924
+ end
1926
1925
 
1927
- def test_templates__template_id__patch
1928
- data = JSON.parse('{
1929
- "name": "new_example_name"
1926
+ def test_templates__template_id__patch
1927
+ data = JSON.parse('{
1928
+ "name": "new_example_name"
1930
1929
  }')
1931
- template_id = "test_url_param"
1932
- headers = JSON.parse('{"X-Mock": 200}')
1930
+ template_id = 'test_url_param'
1931
+ headers = JSON.parse('{"X-Mock": 200}')
1933
1932
 
1934
- response = @sg.client.templates._(template_id).patch(request_body: data, request_headers: headers)
1933
+ response = @sg.client.templates._(template_id).patch(request_body: data, request_headers: headers)
1935
1934
 
1936
- self.assert_equal('200', response.status_code)
1937
- end
1935
+ assert_equal('200', response.status_code)
1936
+ end
1938
1937
 
1939
- def test_templates__template_id__get
1940
- template_id = "test_url_param"
1941
- headers = JSON.parse('{"X-Mock": 200}')
1938
+ def test_templates__template_id__get
1939
+ template_id = 'test_url_param'
1940
+ headers = JSON.parse('{"X-Mock": 200}')
1942
1941
 
1943
- response = @sg.client.templates._(template_id).get(request_headers: headers)
1942
+ response = @sg.client.templates._(template_id).get(request_headers: headers)
1944
1943
 
1945
- self.assert_equal('200', response.status_code)
1946
- end
1944
+ assert_equal('200', response.status_code)
1945
+ end
1947
1946
 
1948
- def test_templates__template_id__delete
1949
- template_id = "test_url_param"
1950
- headers = JSON.parse('{"X-Mock": 204}')
1947
+ def test_templates__template_id__delete
1948
+ template_id = 'test_url_param'
1949
+ headers = JSON.parse('{"X-Mock": 204}')
1951
1950
 
1952
- response = @sg.client.templates._(template_id).delete(request_headers: headers)
1951
+ response = @sg.client.templates._(template_id).delete(request_headers: headers)
1953
1952
 
1954
- self.assert_equal('204', response.status_code)
1955
- end
1953
+ assert_equal('204', response.status_code)
1954
+ end
1956
1955
 
1957
- def test_templates__template_id__versions_post
1958
- data = JSON.parse('{
1959
- "active": 1,
1960
- "html_content": "<%body%>",
1961
- "name": "example_version_name",
1962
- "plain_content": "<%body%>",
1963
- "subject": "<%subject%>",
1964
- "template_id": "ddb96bbc-9b92-425e-8979-99464621b543"
1956
+ def test_templates__template_id__versions_post
1957
+ data = JSON.parse('{
1958
+ "active": 1,
1959
+ "html_content": "<%body%>",
1960
+ "name": "example_version_name",
1961
+ "plain_content": "<%body%>",
1962
+ "subject": "<%subject%>",
1963
+ "template_id": "ddb96bbc-9b92-425e-8979-99464621b543"
1965
1964
  }')
1966
- template_id = "test_url_param"
1967
- headers = JSON.parse('{"X-Mock": 201}')
1965
+ template_id = 'test_url_param'
1966
+ headers = JSON.parse('{"X-Mock": 201}')
1968
1967
 
1969
- response = @sg.client.templates._(template_id).versions.post(request_body: data, request_headers: headers)
1968
+ response = @sg.client.templates._(template_id).versions.post(request_body: data, request_headers: headers)
1970
1969
 
1971
- self.assert_equal('201', response.status_code)
1972
- end
1970
+ assert_equal('201', response.status_code)
1971
+ end
1973
1972
 
1974
- def test_templates__template_id__versions__version_id__patch
1975
- data = JSON.parse('{
1976
- "active": 1,
1977
- "html_content": "<%body%>",
1978
- "name": "updated_example_name",
1979
- "plain_content": "<%body%>",
1980
- "subject": "<%subject%>"
1973
+ def test_templates__template_id__versions__version_id__patch
1974
+ data = JSON.parse('{
1975
+ "active": 1,
1976
+ "html_content": "<%body%>",
1977
+ "name": "updated_example_name",
1978
+ "plain_content": "<%body%>",
1979
+ "subject": "<%subject%>"
1981
1980
  }')
1982
- template_id = "test_url_param"
1983
- version_id = "test_url_param"
1984
- headers = JSON.parse('{"X-Mock": 200}')
1981
+ template_id = 'test_url_param'
1982
+ version_id = 'test_url_param'
1983
+ headers = JSON.parse('{"X-Mock": 200}')
1985
1984
 
1986
- response = @sg.client.templates._(template_id).versions._(version_id).patch(request_body: data, request_headers: headers)
1985
+ response = @sg.client.templates._(template_id).versions._(version_id).patch(request_body: data, request_headers: headers)
1987
1986
 
1988
- self.assert_equal('200', response.status_code)
1989
- end
1987
+ assert_equal('200', response.status_code)
1988
+ end
1990
1989
 
1991
- def test_templates__template_id__versions__version_id__get
1992
- template_id = "test_url_param"
1993
- version_id = "test_url_param"
1994
- headers = JSON.parse('{"X-Mock": 200}')
1990
+ def test_templates__template_id__versions__version_id__get
1991
+ template_id = 'test_url_param'
1992
+ version_id = 'test_url_param'
1993
+ headers = JSON.parse('{"X-Mock": 200}')
1995
1994
 
1996
- response = @sg.client.templates._(template_id).versions._(version_id).get(request_headers: headers)
1995
+ response = @sg.client.templates._(template_id).versions._(version_id).get(request_headers: headers)
1997
1996
 
1998
- self.assert_equal('200', response.status_code)
1999
- end
1997
+ assert_equal('200', response.status_code)
1998
+ end
2000
1999
 
2001
- def test_templates__template_id__versions__version_id__delete
2002
- template_id = "test_url_param"
2003
- version_id = "test_url_param"
2004
- headers = JSON.parse('{"X-Mock": 204}')
2000
+ def test_templates__template_id__versions__version_id__delete
2001
+ template_id = 'test_url_param'
2002
+ version_id = 'test_url_param'
2003
+ headers = JSON.parse('{"X-Mock": 204}')
2005
2004
 
2006
- response = @sg.client.templates._(template_id).versions._(version_id).delete(request_headers: headers)
2005
+ response = @sg.client.templates._(template_id).versions._(version_id).delete(request_headers: headers)
2007
2006
 
2008
- self.assert_equal('204', response.status_code)
2009
- end
2007
+ assert_equal('204', response.status_code)
2008
+ end
2010
2009
 
2011
- def test_templates__template_id__versions__version_id__activate_post
2012
- template_id = "test_url_param"
2013
- version_id = "test_url_param"
2014
- headers = JSON.parse('{"X-Mock": 200}')
2010
+ def test_templates__template_id__versions__version_id__activate_post
2011
+ template_id = 'test_url_param'
2012
+ version_id = 'test_url_param'
2013
+ headers = JSON.parse('{"X-Mock": 200}')
2015
2014
 
2016
- response = @sg.client.templates._(template_id).versions._(version_id).activate.post(request_headers: headers)
2015
+ response = @sg.client.templates._(template_id).versions._(version_id).activate.post(request_headers: headers)
2017
2016
 
2018
- self.assert_equal('200', response.status_code)
2019
- end
2017
+ assert_equal('200', response.status_code)
2018
+ end
2020
2019
 
2021
- def test_tracking_settings_get
2022
- params = JSON.parse('{"limit": 1, "offset": 1}')
2023
- headers = JSON.parse('{"X-Mock": 200}')
2020
+ def test_tracking_settings_get
2021
+ params = JSON.parse('{"limit": 1, "offset": 1}')
2022
+ headers = JSON.parse('{"X-Mock": 200}')
2024
2023
 
2025
- response = @sg.client.tracking_settings.get(query_params: params, request_headers: headers)
2024
+ response = @sg.client.tracking_settings.get(query_params: params, request_headers: headers)
2026
2025
 
2027
- self.assert_equal('200', response.status_code)
2028
- end
2026
+ assert_equal('200', response.status_code)
2027
+ end
2029
2028
 
2030
- def test_tracking_settings_click_patch
2031
- data = JSON.parse('{
2032
- "enabled": true
2029
+ def test_tracking_settings_click_patch
2030
+ data = JSON.parse('{
2031
+ "enabled": true
2033
2032
  }')
2034
- headers = JSON.parse('{"X-Mock": 200}')
2033
+ headers = JSON.parse('{"X-Mock": 200}')
2035
2034
 
2036
- response = @sg.client.tracking_settings.click.patch(request_body: data, request_headers: headers)
2035
+ response = @sg.client.tracking_settings.click.patch(request_body: data, request_headers: headers)
2037
2036
 
2038
- self.assert_equal('200', response.status_code)
2039
- end
2037
+ assert_equal('200', response.status_code)
2038
+ end
2040
2039
 
2041
- def test_tracking_settings_click_get
2042
- headers = JSON.parse('{"X-Mock": 200}')
2040
+ def test_tracking_settings_click_get
2041
+ headers = JSON.parse('{"X-Mock": 200}')
2043
2042
 
2044
- response = @sg.client.tracking_settings.click.get(request_headers: headers)
2043
+ response = @sg.client.tracking_settings.click.get(request_headers: headers)
2045
2044
 
2046
- self.assert_equal('200', response.status_code)
2047
- end
2045
+ assert_equal('200', response.status_code)
2046
+ end
2048
2047
 
2049
- def test_tracking_settings_google_analytics_patch
2050
- data = JSON.parse('{
2051
- "enabled": true,
2052
- "utm_campaign": "website",
2053
- "utm_content": "",
2054
- "utm_medium": "email",
2055
- "utm_source": "sendgrid.com",
2056
- "utm_term": ""
2048
+ def test_tracking_settings_google_analytics_patch
2049
+ data = JSON.parse('{
2050
+ "enabled": true,
2051
+ "utm_campaign": "website",
2052
+ "utm_content": "",
2053
+ "utm_medium": "email",
2054
+ "utm_source": "sendgrid.com",
2055
+ "utm_term": ""
2057
2056
  }')
2058
- headers = JSON.parse('{"X-Mock": 200}')
2057
+ headers = JSON.parse('{"X-Mock": 200}')
2059
2058
 
2060
- response = @sg.client.tracking_settings.google_analytics.patch(request_body: data, request_headers: headers)
2059
+ response = @sg.client.tracking_settings.google_analytics.patch(request_body: data, request_headers: headers)
2061
2060
 
2062
- self.assert_equal('200', response.status_code)
2063
- end
2061
+ assert_equal('200', response.status_code)
2062
+ end
2064
2063
 
2065
- def test_tracking_settings_google_analytics_get
2066
- headers = JSON.parse('{"X-Mock": 200}')
2064
+ def test_tracking_settings_google_analytics_get
2065
+ headers = JSON.parse('{"X-Mock": 200}')
2067
2066
 
2068
- response = @sg.client.tracking_settings.google_analytics.get(request_headers: headers)
2067
+ response = @sg.client.tracking_settings.google_analytics.get(request_headers: headers)
2069
2068
 
2070
- self.assert_equal('200', response.status_code)
2071
- end
2069
+ assert_equal('200', response.status_code)
2070
+ end
2072
2071
 
2073
- def test_tracking_settings_open_patch
2074
- data = JSON.parse('{
2075
- "enabled": true
2072
+ def test_tracking_settings_open_patch
2073
+ data = JSON.parse('{
2074
+ "enabled": true
2076
2075
  }')
2077
- headers = JSON.parse('{"X-Mock": 200}')
2076
+ headers = JSON.parse('{"X-Mock": 200}')
2078
2077
 
2079
- response = @sg.client.tracking_settings.open.patch(request_body: data, request_headers: headers)
2078
+ response = @sg.client.tracking_settings.open.patch(request_body: data, request_headers: headers)
2080
2079
 
2081
- self.assert_equal('200', response.status_code)
2082
- end
2080
+ assert_equal('200', response.status_code)
2081
+ end
2083
2082
 
2084
- def test_tracking_settings_open_get
2085
- headers = JSON.parse('{"X-Mock": 200}')
2083
+ def test_tracking_settings_open_get
2084
+ headers = JSON.parse('{"X-Mock": 200}')
2086
2085
 
2087
- response = @sg.client.tracking_settings.open.get(request_headers: headers)
2086
+ response = @sg.client.tracking_settings.open.get(request_headers: headers)
2088
2087
 
2089
- self.assert_equal('200', response.status_code)
2090
- end
2088
+ assert_equal('200', response.status_code)
2089
+ end
2091
2090
 
2092
- def test_tracking_settings_subscription_patch
2093
- data = JSON.parse('{
2094
- "enabled": true,
2095
- "html_content": "html content",
2096
- "landing": "landing page html",
2097
- "plain_content": "text content",
2098
- "replace": "replacement tag",
2099
- "url": "url"
2091
+ def test_tracking_settings_subscription_patch
2092
+ data = JSON.parse('{
2093
+ "enabled": true,
2094
+ "html_content": "html content",
2095
+ "landing": "landing page html",
2096
+ "plain_content": "text content",
2097
+ "replace": "replacement tag",
2098
+ "url": "url"
2100
2099
  }')
2101
- headers = JSON.parse('{"X-Mock": 200}')
2100
+ headers = JSON.parse('{"X-Mock": 200}')
2102
2101
 
2103
- response = @sg.client.tracking_settings.subscription.patch(request_body: data, request_headers: headers)
2102
+ response = @sg.client.tracking_settings.subscription.patch(request_body: data, request_headers: headers)
2104
2103
 
2105
- self.assert_equal('200', response.status_code)
2106
- end
2104
+ assert_equal('200', response.status_code)
2105
+ end
2107
2106
 
2108
- def test_tracking_settings_subscription_get
2109
- headers = JSON.parse('{"X-Mock": 200}')
2107
+ def test_tracking_settings_subscription_get
2108
+ headers = JSON.parse('{"X-Mock": 200}')
2110
2109
 
2111
- response = @sg.client.tracking_settings.subscription.get(request_headers: headers)
2110
+ response = @sg.client.tracking_settings.subscription.get(request_headers: headers)
2112
2111
 
2113
- self.assert_equal('200', response.status_code)
2114
- end
2112
+ assert_equal('200', response.status_code)
2113
+ end
2115
2114
 
2116
- def test_user_account_get
2117
- headers = JSON.parse('{"X-Mock": 200}')
2115
+ def test_user_account_get
2116
+ headers = JSON.parse('{"X-Mock": 200}')
2118
2117
 
2119
- response = @sg.client.user.account.get(request_headers: headers)
2118
+ response = @sg.client.user.account.get(request_headers: headers)
2120
2119
 
2121
- self.assert_equal('200', response.status_code)
2122
- end
2120
+ assert_equal('200', response.status_code)
2121
+ end
2123
2122
 
2124
- def test_user_credits_get
2125
- headers = JSON.parse('{"X-Mock": 200}')
2123
+ def test_user_credits_get
2124
+ headers = JSON.parse('{"X-Mock": 200}')
2126
2125
 
2127
- response = @sg.client.user.credits.get(request_headers: headers)
2126
+ response = @sg.client.user.credits.get(request_headers: headers)
2128
2127
 
2129
- self.assert_equal('200', response.status_code)
2130
- end
2128
+ assert_equal('200', response.status_code)
2129
+ end
2131
2130
 
2132
- def test_user_email_put
2133
- data = JSON.parse('{
2134
- "email": "example@example.com"
2131
+ def test_user_email_put
2132
+ data = JSON.parse('{
2133
+ "email": "example@example.com"
2135
2134
  }')
2136
- headers = JSON.parse('{"X-Mock": 200}')
2135
+ headers = JSON.parse('{"X-Mock": 200}')
2137
2136
 
2138
- response = @sg.client.user.email.put(request_body: data, request_headers: headers)
2137
+ response = @sg.client.user.email.put(request_body: data, request_headers: headers)
2139
2138
 
2140
- self.assert_equal('200', response.status_code)
2141
- end
2139
+ assert_equal('200', response.status_code)
2140
+ end
2142
2141
 
2143
- def test_user_email_get
2144
- headers = JSON.parse('{"X-Mock": 200}')
2142
+ def test_user_email_get
2143
+ headers = JSON.parse('{"X-Mock": 200}')
2145
2144
 
2146
- response = @sg.client.user.email.get(request_headers: headers)
2145
+ response = @sg.client.user.email.get(request_headers: headers)
2147
2146
 
2148
- self.assert_equal('200', response.status_code)
2149
- end
2147
+ assert_equal('200', response.status_code)
2148
+ end
2150
2149
 
2151
- def test_user_password_put
2152
- data = JSON.parse('{
2153
- "new_password": "new_password",
2154
- "old_password": "old_password"
2150
+ def test_user_password_put
2151
+ data = JSON.parse('{
2152
+ "new_password": "new_password",
2153
+ "old_password": "old_password"
2155
2154
  }')
2156
- headers = JSON.parse('{"X-Mock": 200}')
2155
+ headers = JSON.parse('{"X-Mock": 200}')
2157
2156
 
2158
- response = @sg.client.user.password.put(request_body: data, request_headers: headers)
2157
+ response = @sg.client.user.password.put(request_body: data, request_headers: headers)
2159
2158
 
2160
- self.assert_equal('200', response.status_code)
2161
- end
2159
+ assert_equal('200', response.status_code)
2160
+ end
2162
2161
 
2163
- def test_user_profile_patch
2164
- data = JSON.parse('{
2165
- "city": "Orange",
2166
- "first_name": "Example",
2167
- "last_name": "User"
2162
+ def test_user_profile_patch
2163
+ data = JSON.parse('{
2164
+ "city": "Orange",
2165
+ "first_name": "Example",
2166
+ "last_name": "User"
2168
2167
  }')
2169
- headers = JSON.parse('{"X-Mock": 200}')
2168
+ headers = JSON.parse('{"X-Mock": 200}')
2170
2169
 
2171
- response = @sg.client.user.profile.patch(request_body: data, request_headers: headers)
2170
+ response = @sg.client.user.profile.patch(request_body: data, request_headers: headers)
2172
2171
 
2173
- self.assert_equal('200', response.status_code)
2174
- end
2172
+ assert_equal('200', response.status_code)
2173
+ end
2175
2174
 
2176
- def test_user_profile_get
2177
- headers = JSON.parse('{"X-Mock": 200}')
2175
+ def test_user_profile_get
2176
+ headers = JSON.parse('{"X-Mock": 200}')
2178
2177
 
2179
- response = @sg.client.user.profile.get(request_headers: headers)
2178
+ response = @sg.client.user.profile.get(request_headers: headers)
2180
2179
 
2181
- self.assert_equal('200', response.status_code)
2182
- end
2180
+ assert_equal('200', response.status_code)
2181
+ end
2183
2182
 
2184
- def test_user_scheduled_sends_post
2185
- data = JSON.parse('{
2186
- "batch_id": "YOUR_BATCH_ID",
2187
- "status": "pause"
2183
+ def test_user_scheduled_sends_post
2184
+ data = JSON.parse('{
2185
+ "batch_id": "YOUR_BATCH_ID",
2186
+ "status": "pause"
2188
2187
  }')
2189
- headers = JSON.parse('{"X-Mock": 201}')
2188
+ headers = JSON.parse('{"X-Mock": 201}')
2190
2189
 
2191
- response = @sg.client.user.scheduled_sends.post(request_body: data, request_headers: headers)
2190
+ response = @sg.client.user.scheduled_sends.post(request_body: data, request_headers: headers)
2192
2191
 
2193
- self.assert_equal('201', response.status_code)
2194
- end
2192
+ assert_equal('201', response.status_code)
2193
+ end
2195
2194
 
2196
- def test_user_scheduled_sends_get
2197
- headers = JSON.parse('{"X-Mock": 200}')
2195
+ def test_user_scheduled_sends_get
2196
+ headers = JSON.parse('{"X-Mock": 200}')
2198
2197
 
2199
- response = @sg.client.user.scheduled_sends.get(request_headers: headers)
2198
+ response = @sg.client.user.scheduled_sends.get(request_headers: headers)
2200
2199
 
2201
- self.assert_equal('200', response.status_code)
2202
- end
2200
+ assert_equal('200', response.status_code)
2201
+ end
2203
2202
 
2204
- def test_user_scheduled_sends__batch_id__patch
2205
- data = JSON.parse('{
2206
- "status": "pause"
2203
+ def test_user_scheduled_sends__batch_id__patch
2204
+ data = JSON.parse('{
2205
+ "status": "pause"
2207
2206
  }')
2208
- batch_id = "test_url_param"
2209
- headers = JSON.parse('{"X-Mock": 204}')
2207
+ batch_id = 'test_url_param'
2208
+ headers = JSON.parse('{"X-Mock": 204}')
2210
2209
 
2211
- response = @sg.client.user.scheduled_sends._(batch_id).patch(request_body: data, request_headers: headers)
2210
+ response = @sg.client.user.scheduled_sends._(batch_id).patch(request_body: data, request_headers: headers)
2212
2211
 
2213
- self.assert_equal('204', response.status_code)
2214
- end
2212
+ assert_equal('204', response.status_code)
2213
+ end
2215
2214
 
2216
- def test_user_scheduled_sends__batch_id__get
2217
- batch_id = "test_url_param"
2218
- headers = JSON.parse('{"X-Mock": 200}')
2215
+ def test_user_scheduled_sends__batch_id__get
2216
+ batch_id = 'test_url_param'
2217
+ headers = JSON.parse('{"X-Mock": 200}')
2219
2218
 
2220
- response = @sg.client.user.scheduled_sends._(batch_id).get(request_headers: headers)
2219
+ response = @sg.client.user.scheduled_sends._(batch_id).get(request_headers: headers)
2221
2220
 
2222
- self.assert_equal('200', response.status_code)
2223
- end
2221
+ assert_equal('200', response.status_code)
2222
+ end
2224
2223
 
2225
- def test_user_scheduled_sends__batch_id__delete
2226
- batch_id = "test_url_param"
2227
- headers = JSON.parse('{"X-Mock": 204}')
2224
+ def test_user_scheduled_sends__batch_id__delete
2225
+ batch_id = 'test_url_param'
2226
+ headers = JSON.parse('{"X-Mock": 204}')
2228
2227
 
2229
- response = @sg.client.user.scheduled_sends._(batch_id).delete(request_headers: headers)
2228
+ response = @sg.client.user.scheduled_sends._(batch_id).delete(request_headers: headers)
2230
2229
 
2231
- self.assert_equal('204', response.status_code)
2232
- end
2230
+ assert_equal('204', response.status_code)
2231
+ end
2233
2232
 
2234
- def test_user_settings_enforced_tls_patch
2235
- data = JSON.parse('{
2236
- "require_tls": true,
2237
- "require_valid_cert": false
2233
+ def test_user_settings_enforced_tls_patch
2234
+ data = JSON.parse('{
2235
+ "require_tls": true,
2236
+ "require_valid_cert": false
2238
2237
  }')
2239
- headers = JSON.parse('{"X-Mock": 200}')
2238
+ headers = JSON.parse('{"X-Mock": 200}')
2240
2239
 
2241
- response = @sg.client.user.settings.enforced_tls.patch(request_body: data, request_headers: headers)
2240
+ response = @sg.client.user.settings.enforced_tls.patch(request_body: data, request_headers: headers)
2242
2241
 
2243
- self.assert_equal('200', response.status_code)
2244
- end
2242
+ assert_equal('200', response.status_code)
2243
+ end
2245
2244
 
2246
- def test_user_settings_enforced_tls_get
2247
- headers = JSON.parse('{"X-Mock": 200}')
2245
+ def test_user_settings_enforced_tls_get
2246
+ headers = JSON.parse('{"X-Mock": 200}')
2248
2247
 
2249
- response = @sg.client.user.settings.enforced_tls.get(request_headers: headers)
2248
+ response = @sg.client.user.settings.enforced_tls.get(request_headers: headers)
2250
2249
 
2251
- self.assert_equal('200', response.status_code)
2252
- end
2250
+ assert_equal('200', response.status_code)
2251
+ end
2253
2252
 
2254
- def test_user_username_put
2255
- data = JSON.parse('{
2256
- "username": "test_username"
2253
+ def test_user_username_put
2254
+ data = JSON.parse('{
2255
+ "username": "test_username"
2257
2256
  }')
2258
- headers = JSON.parse('{"X-Mock": 200}')
2257
+ headers = JSON.parse('{"X-Mock": 200}')
2259
2258
 
2260
- response = @sg.client.user.username.put(request_body: data, request_headers: headers)
2259
+ response = @sg.client.user.username.put(request_body: data, request_headers: headers)
2261
2260
 
2262
- self.assert_equal('200', response.status_code)
2263
- end
2261
+ assert_equal('200', response.status_code)
2262
+ end
2264
2263
 
2265
- def test_user_username_get
2266
- headers = JSON.parse('{"X-Mock": 200}')
2264
+ def test_user_username_get
2265
+ headers = JSON.parse('{"X-Mock": 200}')
2267
2266
 
2268
- response = @sg.client.user.username.get(request_headers: headers)
2267
+ response = @sg.client.user.username.get(request_headers: headers)
2269
2268
 
2270
- self.assert_equal('200', response.status_code)
2271
- end
2269
+ assert_equal('200', response.status_code)
2270
+ end
2272
2271
 
2273
- def test_user_webhooks_event_settings_patch
2274
- data = JSON.parse('{
2275
- "bounce": true,
2276
- "click": true,
2277
- "deferred": true,
2278
- "delivered": true,
2279
- "dropped": true,
2280
- "enabled": true,
2281
- "group_resubscribe": true,
2282
- "group_unsubscribe": true,
2283
- "open": true,
2284
- "processed": true,
2285
- "spam_report": true,
2286
- "unsubscribe": true,
2287
- "url": "url"
2272
+ def test_user_webhooks_event_settings_patch
2273
+ data = JSON.parse('{
2274
+ "bounce": true,
2275
+ "click": true,
2276
+ "deferred": true,
2277
+ "delivered": true,
2278
+ "dropped": true,
2279
+ "enabled": true,
2280
+ "group_resubscribe": true,
2281
+ "group_unsubscribe": true,
2282
+ "open": true,
2283
+ "processed": true,
2284
+ "spam_report": true,
2285
+ "unsubscribe": true,
2286
+ "url": "url"
2288
2287
  }')
2289
- headers = JSON.parse('{"X-Mock": 200}')
2288
+ headers = JSON.parse('{"X-Mock": 200}')
2290
2289
 
2291
- response = @sg.client.user.webhooks.event.settings.patch(request_body: data, request_headers: headers)
2290
+ response = @sg.client.user.webhooks.event.settings.patch(request_body: data, request_headers: headers)
2292
2291
 
2293
- self.assert_equal('200', response.status_code)
2294
- end
2292
+ assert_equal('200', response.status_code)
2293
+ end
2295
2294
 
2296
- def test_user_webhooks_event_settings_get
2297
- headers = JSON.parse('{"X-Mock": 200}')
2295
+ def test_user_webhooks_event_settings_get
2296
+ headers = JSON.parse('{"X-Mock": 200}')
2298
2297
 
2299
- response = @sg.client.user.webhooks.event.settings.get(request_headers: headers)
2298
+ response = @sg.client.user.webhooks.event.settings.get(request_headers: headers)
2300
2299
 
2301
- self.assert_equal('200', response.status_code)
2302
- end
2300
+ assert_equal('200', response.status_code)
2301
+ end
2303
2302
 
2304
- def test_user_webhooks_event_test_post
2305
- data = JSON.parse('{
2306
- "url": "url"
2303
+ def test_user_webhooks_event_test_post
2304
+ data = JSON.parse('{
2305
+ "url": "url"
2307
2306
  }')
2308
- headers = JSON.parse('{"X-Mock": 204}')
2307
+ headers = JSON.parse('{"X-Mock": 204}')
2309
2308
 
2310
- response = @sg.client.user.webhooks.event.test.post(request_body: data, request_headers: headers)
2309
+ response = @sg.client.user.webhooks.event.test.post(request_body: data, request_headers: headers)
2311
2310
 
2312
- self.assert_equal('204', response.status_code)
2313
- end
2311
+ assert_equal('204', response.status_code)
2312
+ end
2314
2313
 
2315
- def test_user_webhooks_parse_settings_post
2316
- data = JSON.parse('{
2317
- "hostname": "myhostname.com",
2318
- "send_raw": false,
2319
- "spam_check": true,
2320
- "url": "http://email.myhosthame.com"
2314
+ def test_user_webhooks_parse_settings_post
2315
+ data = JSON.parse('{
2316
+ "hostname": "myhostname.com",
2317
+ "send_raw": false,
2318
+ "spam_check": true,
2319
+ "url": "http://email.myhosthame.com"
2321
2320
  }')
2322
- headers = JSON.parse('{"X-Mock": 201}')
2321
+ headers = JSON.parse('{"X-Mock": 201}')
2323
2322
 
2324
- response = @sg.client.user.webhooks.parse.settings.post(request_body: data, request_headers: headers)
2323
+ response = @sg.client.user.webhooks.parse.settings.post(request_body: data, request_headers: headers)
2325
2324
 
2326
- self.assert_equal('201', response.status_code)
2327
- end
2325
+ assert_equal('201', response.status_code)
2326
+ end
2328
2327
 
2329
- def test_user_webhooks_parse_settings_get
2330
- headers = JSON.parse('{"X-Mock": 200}')
2328
+ def test_user_webhooks_parse_settings_get
2329
+ headers = JSON.parse('{"X-Mock": 200}')
2331
2330
 
2332
- response = @sg.client.user.webhooks.parse.settings.get(request_headers: headers)
2331
+ response = @sg.client.user.webhooks.parse.settings.get(request_headers: headers)
2333
2332
 
2334
- self.assert_equal('200', response.status_code)
2335
- end
2333
+ assert_equal('200', response.status_code)
2334
+ end
2336
2335
 
2337
- def test_user_webhooks_parse_settings__hostname__patch
2338
- data = JSON.parse('{
2339
- "send_raw": true,
2340
- "spam_check": false,
2341
- "url": "http://newdomain.com/parse"
2336
+ def test_user_webhooks_parse_settings__hostname__patch
2337
+ data = JSON.parse('{
2338
+ "send_raw": true,
2339
+ "spam_check": false,
2340
+ "url": "http://newdomain.com/parse"
2342
2341
  }')
2343
- hostname = "test_url_param"
2344
- headers = JSON.parse('{"X-Mock": 200}')
2342
+ hostname = 'test_url_param'
2343
+ headers = JSON.parse('{"X-Mock": 200}')
2345
2344
 
2346
- response = @sg.client.user.webhooks.parse.settings._(hostname).patch(request_body: data, request_headers: headers)
2345
+ response = @sg.client.user.webhooks.parse.settings._(hostname).patch(request_body: data, request_headers: headers)
2347
2346
 
2348
- self.assert_equal('200', response.status_code)
2349
- end
2347
+ assert_equal('200', response.status_code)
2348
+ end
2350
2349
 
2351
- def test_user_webhooks_parse_settings__hostname__get
2352
- hostname = "test_url_param"
2353
- headers = JSON.parse('{"X-Mock": 200}')
2350
+ def test_user_webhooks_parse_settings__hostname__get
2351
+ hostname = 'test_url_param'
2352
+ headers = JSON.parse('{"X-Mock": 200}')
2354
2353
 
2355
- response = @sg.client.user.webhooks.parse.settings._(hostname).get(request_headers: headers)
2354
+ response = @sg.client.user.webhooks.parse.settings._(hostname).get(request_headers: headers)
2356
2355
 
2357
- self.assert_equal('200', response.status_code)
2358
- end
2356
+ assert_equal('200', response.status_code)
2357
+ end
2359
2358
 
2360
- def test_user_webhooks_parse_settings__hostname__delete
2361
- hostname = "test_url_param"
2362
- headers = JSON.parse('{"X-Mock": 204}')
2359
+ def test_user_webhooks_parse_settings__hostname__delete
2360
+ hostname = 'test_url_param'
2361
+ headers = JSON.parse('{"X-Mock": 204}')
2363
2362
 
2364
- response = @sg.client.user.webhooks.parse.settings._(hostname).delete(request_headers: headers)
2363
+ response = @sg.client.user.webhooks.parse.settings._(hostname).delete(request_headers: headers)
2365
2364
 
2366
- self.assert_equal('204', response.status_code)
2367
- end
2365
+ assert_equal('204', response.status_code)
2366
+ end
2368
2367
 
2369
- def test_user_webhooks_parse_stats_get
2370
- params = JSON.parse('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}')
2371
- headers = JSON.parse('{"X-Mock": 200}')
2368
+ def test_user_webhooks_parse_stats_get
2369
+ params = JSON.parse('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}')
2370
+ headers = JSON.parse('{"X-Mock": 200}')
2372
2371
 
2373
- response = @sg.client.user.webhooks.parse.stats.get(query_params: params, request_headers: headers)
2372
+ response = @sg.client.user.webhooks.parse.stats.get(query_params: params, request_headers: headers)
2374
2373
 
2375
- self.assert_equal('200', response.status_code)
2376
- end
2374
+ assert_equal('200', response.status_code)
2375
+ end
2377
2376
 
2378
- def test_whitelabel_domains_post
2379
- data = JSON.parse('{
2380
- "automatic_security": false,
2381
- "custom_spf": true,
2382
- "default": true,
2383
- "domain": "example.com",
2384
- "ips": [
2385
- "192.168.1.1",
2386
- "192.168.1.2"
2387
- ],
2388
- "subdomain": "news",
2389
- "username": "john@example.com"
2377
+ def test_whitelabel_domains_post
2378
+ data = JSON.parse('{
2379
+ "automatic_security": false,
2380
+ "custom_spf": true,
2381
+ "default": true,
2382
+ "domain": "example.com",
2383
+ "ips": [
2384
+ "192.168.1.1",
2385
+ "192.168.1.2"
2386
+ ],
2387
+ "subdomain": "news",
2388
+ "username": "john@example.com"
2390
2389
  }')
2391
- headers = JSON.parse('{"X-Mock": 201}')
2390
+ headers = JSON.parse('{"X-Mock": 201}')
2392
2391
 
2393
- response = @sg.client.whitelabel.domains.post(request_body: data, request_headers: headers)
2392
+ response = @sg.client.whitelabel.domains.post(request_body: data, request_headers: headers)
2394
2393
 
2395
- self.assert_equal('201', response.status_code)
2396
- end
2394
+ assert_equal('201', response.status_code)
2395
+ end
2397
2396
 
2398
- def test_whitelabel_domains_get
2399
- params = JSON.parse('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}')
2400
- headers = JSON.parse('{"X-Mock": 200}')
2397
+ def test_whitelabel_domains_get
2398
+ params = JSON.parse('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}')
2399
+ headers = JSON.parse('{"X-Mock": 200}')
2401
2400
 
2402
- response = @sg.client.whitelabel.domains.get(query_params: params, request_headers: headers)
2401
+ response = @sg.client.whitelabel.domains.get(query_params: params, request_headers: headers)
2403
2402
 
2404
- self.assert_equal('200', response.status_code)
2405
- end
2403
+ assert_equal('200', response.status_code)
2404
+ end
2406
2405
 
2407
- def test_whitelabel_domains_default_get
2408
- headers = JSON.parse('{"X-Mock": 200}')
2406
+ def test_whitelabel_domains_default_get
2407
+ headers = JSON.parse('{"X-Mock": 200}')
2409
2408
 
2410
- response = @sg.client.whitelabel.domains.default.get(request_headers: headers)
2409
+ response = @sg.client.whitelabel.domains.default.get(request_headers: headers)
2411
2410
 
2412
- self.assert_equal('200', response.status_code)
2413
- end
2411
+ assert_equal('200', response.status_code)
2412
+ end
2414
2413
 
2415
- def test_whitelabel_domains_subuser_get
2416
- headers = JSON.parse('{"X-Mock": 200}')
2414
+ def test_whitelabel_domains_subuser_get
2415
+ headers = JSON.parse('{"X-Mock": 200}')
2417
2416
 
2418
- response = @sg.client.whitelabel.domains.subuser.get(request_headers: headers)
2417
+ response = @sg.client.whitelabel.domains.subuser.get(request_headers: headers)
2419
2418
 
2420
- self.assert_equal('200', response.status_code)
2421
- end
2419
+ assert_equal('200', response.status_code)
2420
+ end
2422
2421
 
2423
- def test_whitelabel_domains_subuser_delete
2424
- headers = JSON.parse('{"X-Mock": 204}')
2422
+ def test_whitelabel_domains_subuser_delete
2423
+ headers = JSON.parse('{"X-Mock": 204}')
2425
2424
 
2426
- response = @sg.client.whitelabel.domains.subuser.delete(request_headers: headers)
2425
+ response = @sg.client.whitelabel.domains.subuser.delete(request_headers: headers)
2427
2426
 
2428
- self.assert_equal('204', response.status_code)
2429
- end
2427
+ assert_equal('204', response.status_code)
2428
+ end
2430
2429
 
2431
- def test_whitelabel_domains__domain_id__patch
2432
- data = JSON.parse('{
2433
- "custom_spf": true,
2434
- "default": false
2430
+ def test_whitelabel_domains__domain_id__patch
2431
+ data = JSON.parse('{
2432
+ "custom_spf": true,
2433
+ "default": false
2435
2434
  }')
2436
- domain_id = "test_url_param"
2437
- headers = JSON.parse('{"X-Mock": 200}')
2435
+ domain_id = 'test_url_param'
2436
+ headers = JSON.parse('{"X-Mock": 200}')
2438
2437
 
2439
- response = @sg.client.whitelabel.domains._(domain_id).patch(request_body: data, request_headers: headers)
2438
+ response = @sg.client.whitelabel.domains._(domain_id).patch(request_body: data, request_headers: headers)
2440
2439
 
2441
- self.assert_equal('200', response.status_code)
2442
- end
2440
+ assert_equal('200', response.status_code)
2441
+ end
2443
2442
 
2444
- def test_whitelabel_domains__domain_id__get
2445
- domain_id = "test_url_param"
2446
- headers = JSON.parse('{"X-Mock": 200}')
2443
+ def test_whitelabel_domains__domain_id__get
2444
+ domain_id = 'test_url_param'
2445
+ headers = JSON.parse('{"X-Mock": 200}')
2447
2446
 
2448
- response = @sg.client.whitelabel.domains._(domain_id).get(request_headers: headers)
2447
+ response = @sg.client.whitelabel.domains._(domain_id).get(request_headers: headers)
2449
2448
 
2450
- self.assert_equal('200', response.status_code)
2451
- end
2449
+ assert_equal('200', response.status_code)
2450
+ end
2452
2451
 
2453
- def test_whitelabel_domains__domain_id__delete
2454
- domain_id = "test_url_param"
2455
- headers = JSON.parse('{"X-Mock": 204}')
2452
+ def test_whitelabel_domains__domain_id__delete
2453
+ domain_id = 'test_url_param'
2454
+ headers = JSON.parse('{"X-Mock": 204}')
2456
2455
 
2457
- response = @sg.client.whitelabel.domains._(domain_id).delete(request_headers: headers)
2456
+ response = @sg.client.whitelabel.domains._(domain_id).delete(request_headers: headers)
2458
2457
 
2459
- self.assert_equal('204', response.status_code)
2460
- end
2458
+ assert_equal('204', response.status_code)
2459
+ end
2461
2460
 
2462
- def test_whitelabel_domains__domain_id__subuser_post
2463
- data = JSON.parse('{
2464
- "username": "jane@example.com"
2461
+ def test_whitelabel_domains__domain_id__subuser_post
2462
+ data = JSON.parse('{
2463
+ "username": "jane@example.com"
2465
2464
  }')
2466
- domain_id = "test_url_param"
2467
- headers = JSON.parse('{"X-Mock": 201}')
2465
+ domain_id = 'test_url_param'
2466
+ headers = JSON.parse('{"X-Mock": 201}')
2468
2467
 
2469
- response = @sg.client.whitelabel.domains._(domain_id).subuser.post(request_body: data, request_headers: headers)
2468
+ response = @sg.client.whitelabel.domains._(domain_id).subuser.post(request_body: data, request_headers: headers)
2470
2469
 
2471
- self.assert_equal('201', response.status_code)
2472
- end
2470
+ assert_equal('201', response.status_code)
2471
+ end
2473
2472
 
2474
- def test_whitelabel_domains__id__ips_post
2475
- data = JSON.parse('{
2476
- "ip": "192.168.0.1"
2473
+ def test_whitelabel_domains__id__ips_post
2474
+ data = JSON.parse('{
2475
+ "ip": "192.168.0.1"
2477
2476
  }')
2478
- id = "test_url_param"
2479
- headers = JSON.parse('{"X-Mock": 200}')
2477
+ id = 'test_url_param'
2478
+ headers = JSON.parse('{"X-Mock": 200}')
2480
2479
 
2481
- response = @sg.client.whitelabel.domains._(id).ips.post(request_body: data, request_headers: headers)
2480
+ response = @sg.client.whitelabel.domains._(id).ips.post(request_body: data, request_headers: headers)
2482
2481
 
2483
- self.assert_equal('200', response.status_code)
2484
- end
2482
+ assert_equal('200', response.status_code)
2483
+ end
2485
2484
 
2486
- def test_whitelabel_domains__id__ips__ip__delete
2487
- id = "test_url_param"
2488
- ip = "test_url_param"
2489
- headers = JSON.parse('{"X-Mock": 200}')
2485
+ def test_whitelabel_domains__id__ips__ip__delete
2486
+ id = 'test_url_param'
2487
+ ip = 'test_url_param'
2488
+ headers = JSON.parse('{"X-Mock": 200}')
2490
2489
 
2491
- response = @sg.client.whitelabel.domains._(id).ips._(ip).delete(request_headers: headers)
2490
+ response = @sg.client.whitelabel.domains._(id).ips._(ip).delete(request_headers: headers)
2492
2491
 
2493
- self.assert_equal('200', response.status_code)
2494
- end
2492
+ assert_equal('200', response.status_code)
2493
+ end
2495
2494
 
2496
- def test_whitelabel_domains__id__validate_post
2497
- id = "test_url_param"
2498
- headers = JSON.parse('{"X-Mock": 200}')
2495
+ def test_whitelabel_domains__id__validate_post
2496
+ id = 'test_url_param'
2497
+ headers = JSON.parse('{"X-Mock": 200}')
2499
2498
 
2500
- response = @sg.client.whitelabel.domains._(id).validate.post(request_headers: headers)
2499
+ response = @sg.client.whitelabel.domains._(id).validate.post(request_headers: headers)
2501
2500
 
2502
- self.assert_equal('200', response.status_code)
2503
- end
2501
+ assert_equal('200', response.status_code)
2502
+ end
2504
2503
 
2505
- def test_whitelabel_ips_post
2506
- data = JSON.parse('{
2507
- "domain": "example.com",
2508
- "ip": "192.168.1.1",
2509
- "subdomain": "email"
2504
+ def test_whitelabel_ips_post
2505
+ data = JSON.parse('{
2506
+ "domain": "example.com",
2507
+ "ip": "192.168.1.1",
2508
+ "subdomain": "email"
2510
2509
  }')
2511
- headers = JSON.parse('{"X-Mock": 201}')
2510
+ headers = JSON.parse('{"X-Mock": 201}')
2512
2511
 
2513
- response = @sg.client.whitelabel.ips.post(request_body: data, request_headers: headers)
2512
+ response = @sg.client.whitelabel.ips.post(request_body: data, request_headers: headers)
2514
2513
 
2515
- self.assert_equal('201', response.status_code)
2516
- end
2514
+ assert_equal('201', response.status_code)
2515
+ end
2517
2516
 
2518
- def test_whitelabel_ips_get
2519
- params = JSON.parse('{"ip": "test_string", "limit": 1, "offset": 1}')
2520
- headers = JSON.parse('{"X-Mock": 200}')
2517
+ def test_whitelabel_ips_get
2518
+ params = JSON.parse('{"ip": "test_string", "limit": 1, "offset": 1}')
2519
+ headers = JSON.parse('{"X-Mock": 200}')
2521
2520
 
2522
- response = @sg.client.whitelabel.ips.get(query_params: params, request_headers: headers)
2521
+ response = @sg.client.whitelabel.ips.get(query_params: params, request_headers: headers)
2523
2522
 
2524
- self.assert_equal('200', response.status_code)
2525
- end
2523
+ assert_equal('200', response.status_code)
2524
+ end
2526
2525
 
2527
- def test_whitelabel_ips__id__get
2528
- id = "test_url_param"
2529
- headers = JSON.parse('{"X-Mock": 200}')
2526
+ def test_whitelabel_ips__id__get
2527
+ id = 'test_url_param'
2528
+ headers = JSON.parse('{"X-Mock": 200}')
2530
2529
 
2531
- response = @sg.client.whitelabel.ips._(id).get(request_headers: headers)
2530
+ response = @sg.client.whitelabel.ips._(id).get(request_headers: headers)
2532
2531
 
2533
- self.assert_equal('200', response.status_code)
2534
- end
2532
+ assert_equal('200', response.status_code)
2533
+ end
2535
2534
 
2536
- def test_whitelabel_ips__id__delete
2537
- id = "test_url_param"
2538
- headers = JSON.parse('{"X-Mock": 204}')
2535
+ def test_whitelabel_ips__id__delete
2536
+ id = 'test_url_param'
2537
+ headers = JSON.parse('{"X-Mock": 204}')
2539
2538
 
2540
- response = @sg.client.whitelabel.ips._(id).delete(request_headers: headers)
2539
+ response = @sg.client.whitelabel.ips._(id).delete(request_headers: headers)
2541
2540
 
2542
- self.assert_equal('204', response.status_code)
2543
- end
2541
+ assert_equal('204', response.status_code)
2542
+ end
2544
2543
 
2545
- def test_whitelabel_ips__id__validate_post
2546
- id = "test_url_param"
2547
- headers = JSON.parse('{"X-Mock": 200}')
2544
+ def test_whitelabel_ips__id__validate_post
2545
+ id = 'test_url_param'
2546
+ headers = JSON.parse('{"X-Mock": 200}')
2548
2547
 
2549
- response = @sg.client.whitelabel.ips._(id).validate.post(request_headers: headers)
2548
+ response = @sg.client.whitelabel.ips._(id).validate.post(request_headers: headers)
2550
2549
 
2551
- self.assert_equal('200', response.status_code)
2552
- end
2550
+ assert_equal('200', response.status_code)
2551
+ end
2553
2552
 
2554
- def test_whitelabel_links_post
2555
- data = JSON.parse('{
2556
- "default": true,
2557
- "domain": "example.com",
2558
- "subdomain": "mail"
2553
+ def test_whitelabel_links_post
2554
+ data = JSON.parse('{
2555
+ "default": true,
2556
+ "domain": "example.com",
2557
+ "subdomain": "mail"
2559
2558
  }')
2560
- params = JSON.parse('{"limit": 1, "offset": 1}')
2561
- headers = JSON.parse('{"X-Mock": 201}')
2559
+ params = JSON.parse('{"limit": 1, "offset": 1}')
2560
+ headers = JSON.parse('{"X-Mock": 201}')
2562
2561
 
2563
- response = @sg.client.whitelabel.links.post(request_body: data, query_params: params, request_headers: headers)
2562
+ response = @sg.client.whitelabel.links.post(request_body: data, query_params: params, request_headers: headers)
2564
2563
 
2565
- self.assert_equal('201', response.status_code)
2566
- end
2564
+ assert_equal('201', response.status_code)
2565
+ end
2567
2566
 
2568
- def test_whitelabel_links_get
2569
- params = JSON.parse('{"limit": 1}')
2570
- headers = JSON.parse('{"X-Mock": 200}')
2567
+ def test_whitelabel_links_get
2568
+ params = JSON.parse('{"limit": 1}')
2569
+ headers = JSON.parse('{"X-Mock": 200}')
2571
2570
 
2572
- response = @sg.client.whitelabel.links.get(query_params: params, request_headers: headers)
2571
+ response = @sg.client.whitelabel.links.get(query_params: params, request_headers: headers)
2573
2572
 
2574
- self.assert_equal('200', response.status_code)
2575
- end
2573
+ assert_equal('200', response.status_code)
2574
+ end
2576
2575
 
2577
- def test_whitelabel_links_default_get
2578
- params = JSON.parse('{"domain": "test_string"}')
2579
- headers = JSON.parse('{"X-Mock": 200}')
2576
+ def test_whitelabel_links_default_get
2577
+ params = JSON.parse('{"domain": "test_string"}')
2578
+ headers = JSON.parse('{"X-Mock": 200}')
2580
2579
 
2581
- response = @sg.client.whitelabel.links.default.get(query_params: params, request_headers: headers)
2580
+ response = @sg.client.whitelabel.links.default.get(query_params: params, request_headers: headers)
2582
2581
 
2583
- self.assert_equal('200', response.status_code)
2584
- end
2582
+ assert_equal('200', response.status_code)
2583
+ end
2585
2584
 
2586
- def test_whitelabel_links_subuser_get
2587
- params = JSON.parse('{"username": "test_string"}')
2588
- headers = JSON.parse('{"X-Mock": 200}')
2585
+ def test_whitelabel_links_subuser_get
2586
+ params = JSON.parse('{"username": "test_string"}')
2587
+ headers = JSON.parse('{"X-Mock": 200}')
2589
2588
 
2590
- response = @sg.client.whitelabel.links.subuser.get(query_params: params, request_headers: headers)
2589
+ response = @sg.client.whitelabel.links.subuser.get(query_params: params, request_headers: headers)
2591
2590
 
2592
- self.assert_equal('200', response.status_code)
2593
- end
2591
+ assert_equal('200', response.status_code)
2592
+ end
2594
2593
 
2595
- def test_whitelabel_links_subuser_delete
2596
- params = JSON.parse('{"username": "test_string"}')
2597
- headers = JSON.parse('{"X-Mock": 204}')
2594
+ def test_whitelabel_links_subuser_delete
2595
+ params = JSON.parse('{"username": "test_string"}')
2596
+ headers = JSON.parse('{"X-Mock": 204}')
2598
2597
 
2599
- response = @sg.client.whitelabel.links.subuser.delete(query_params: params, request_headers: headers)
2598
+ response = @sg.client.whitelabel.links.subuser.delete(query_params: params, request_headers: headers)
2600
2599
 
2601
- self.assert_equal('204', response.status_code)
2602
- end
2600
+ assert_equal('204', response.status_code)
2601
+ end
2603
2602
 
2604
- def test_whitelabel_links__id__patch
2605
- data = JSON.parse('{
2606
- "default": true
2603
+ def test_whitelabel_links__id__patch
2604
+ data = JSON.parse('{
2605
+ "default": true
2607
2606
  }')
2608
- id = "test_url_param"
2609
- headers = JSON.parse('{"X-Mock": 200}')
2607
+ id = 'test_url_param'
2608
+ headers = JSON.parse('{"X-Mock": 200}')
2610
2609
 
2611
- response = @sg.client.whitelabel.links._(id).patch(request_body: data, request_headers: headers)
2610
+ response = @sg.client.whitelabel.links._(id).patch(request_body: data, request_headers: headers)
2612
2611
 
2613
- self.assert_equal('200', response.status_code)
2614
- end
2612
+ assert_equal('200', response.status_code)
2613
+ end
2615
2614
 
2616
- def test_whitelabel_links__id__get
2617
- id = "test_url_param"
2618
- headers = JSON.parse('{"X-Mock": 200}')
2615
+ def test_whitelabel_links__id__get
2616
+ id = 'test_url_param'
2617
+ headers = JSON.parse('{"X-Mock": 200}')
2619
2618
 
2620
- response = @sg.client.whitelabel.links._(id).get(request_headers: headers)
2619
+ response = @sg.client.whitelabel.links._(id).get(request_headers: headers)
2621
2620
 
2622
- self.assert_equal('200', response.status_code)
2623
- end
2621
+ assert_equal('200', response.status_code)
2622
+ end
2624
2623
 
2625
- def test_whitelabel_links__id__delete
2626
- id = "test_url_param"
2627
- headers = JSON.parse('{"X-Mock": 204}')
2624
+ def test_whitelabel_links__id__delete
2625
+ id = 'test_url_param'
2626
+ headers = JSON.parse('{"X-Mock": 204}')
2628
2627
 
2629
- response = @sg.client.whitelabel.links._(id).delete(request_headers: headers)
2628
+ response = @sg.client.whitelabel.links._(id).delete(request_headers: headers)
2630
2629
 
2631
- self.assert_equal('204', response.status_code)
2632
- end
2630
+ assert_equal('204', response.status_code)
2631
+ end
2633
2632
 
2634
- def test_whitelabel_links__id__validate_post
2635
- id = "test_url_param"
2636
- headers = JSON.parse('{"X-Mock": 200}')
2633
+ def test_whitelabel_links__id__validate_post
2634
+ id = 'test_url_param'
2635
+ headers = JSON.parse('{"X-Mock": 200}')
2637
2636
 
2638
- response = @sg.client.whitelabel.links._(id).validate.post(request_headers: headers)
2637
+ response = @sg.client.whitelabel.links._(id).validate.post(request_headers: headers)
2639
2638
 
2640
- self.assert_equal('200', response.status_code)
2641
- end
2639
+ assert_equal('200', response.status_code)
2640
+ end
2642
2641
 
2643
- def test_whitelabel_links__link_id__subuser_post
2644
- data = JSON.parse('{
2645
- "username": "jane@example.com"
2642
+ def test_whitelabel_links__link_id__subuser_post
2643
+ data = JSON.parse('{
2644
+ "username": "jane@example.com"
2646
2645
  }')
2647
- link_id = "test_url_param"
2648
- headers = JSON.parse('{"X-Mock": 200}')
2646
+ link_id = 'test_url_param'
2647
+ headers = JSON.parse('{"X-Mock": 200}')
2649
2648
 
2650
- response = @sg.client.whitelabel.links._(link_id).subuser.post(request_body: data, request_headers: headers)
2649
+ response = @sg.client.whitelabel.links._(link_id).subuser.post(request_body: data, request_headers: headers)
2651
2650
 
2652
- self.assert_equal('200', response.status_code)
2653
- end
2651
+ assert_equal('200', response.status_code)
2652
+ end
2654
2653
 
2655
- def test_license_file_year
2656
- # Read the third line from the license file
2657
- year = IO.readlines('./LICENSE.md')[2].gsub(/[^\d]/, '')
2658
- self.assert_equal("#{Time.now.year}", year)
2659
- end
2654
+ def test_license_file_year
2655
+ # Read the third line from the license file
2656
+ year = IO.readlines('./LICENSE.md')[2].gsub(/[^\d]/, '')
2657
+ assert_equal(Time.now.year.to_s, year)
2658
+ end
2660
2659
 
2661
- def test_env_sample_exists
2662
- assert(File.file?('./.env_sample'))
2663
- end
2660
+ def test_env_sample_exists
2661
+ assert(File.file?('./.env_sample'))
2662
+ end
2664
2663
 
2665
- def test_gitignore_exists
2666
- assert(File.file?('./.gitignore'))
2667
- end
2664
+ def test_gitignore_exists
2665
+ assert(File.file?('./.gitignore'))
2666
+ end
2668
2667
 
2669
- def test_travis_exists
2670
- assert(File.file?('./.travis.yml'))
2671
- end
2668
+ def test_travis_exists
2669
+ assert(File.file?('./.travis.yml'))
2670
+ end
2672
2671
 
2673
- def test_codeclimate_exists
2674
- assert(File.file?('./.codeclimate.yml'))
2675
- end
2672
+ def test_codeclimate_exists
2673
+ assert(File.file?('./.codeclimate.yml'))
2674
+ end
2676
2675
 
2677
- def test_changelog_exists
2678
- assert(File.file?('./CHANGELOG.md'))
2679
- end
2676
+ def test_changelog_exists
2677
+ assert(File.file?('./CHANGELOG.md'))
2678
+ end
2680
2679
 
2681
- def test_code_of_conduct_exists
2682
- assert(File.file?('./CODE_OF_CONDUCT.md'))
2683
- end
2680
+ def test_code_of_conduct_exists
2681
+ assert(File.file?('./CODE_OF_CONDUCT.md'))
2682
+ end
2684
2683
 
2685
- def test_contributing_exists
2686
- assert(File.file?('./CONTRIBUTING.md'))
2687
- end
2684
+ def test_contributing_exists
2685
+ assert(File.file?('./CONTRIBUTING.md'))
2686
+ end
2688
2687
 
2689
- def test_issue_template_exists
2690
- assert(File.file?('./ISSUE_TEMPLATE.md'))
2691
- end
2688
+ def test_issue_template_exists
2689
+ assert(File.file?('./ISSUE_TEMPLATE.md'))
2690
+ end
2692
2691
 
2693
- def test_license_exists
2694
- assert(File.file?('./LICENSE.md'))
2695
- end
2692
+ def test_license_exists
2693
+ assert(File.file?('./LICENSE.md'))
2694
+ end
2696
2695
 
2697
- def test_pr_template_exists
2698
- assert(File.file?('./PULL_REQUEST_TEMPLATE.md'))
2699
- end
2696
+ def test_pull_request_template_exists
2697
+ assert(File.file?('./PULL_REQUEST_TEMPLATE.md'))
2698
+ end
2700
2699
 
2701
- def test_readme_exists
2702
- assert(File.file?('./README.md'))
2703
- end
2700
+ def test_readme_exists
2701
+ assert(File.file?('./README.md'))
2702
+ end
2704
2703
 
2705
- def test_troubleshooting_exists
2706
- assert(File.file?('./TROUBLESHOOTING.md'))
2707
- end
2704
+ def test_troubleshooting_exists
2705
+ assert(File.file?('./TROUBLESHOOTING.md'))
2706
+ end
2708
2707
 
2709
- def test_usage_exists
2710
- assert(File.file?('./USAGE.md'))
2711
- end
2708
+ def test_usage_exists
2709
+ assert(File.file?('./USAGE.md'))
2710
+ end
2712
2711
 
2713
- def test_use_cases_readme_exists
2714
- assert(File.file?('./use-cases/README.md'))
2715
- end
2712
+ def test_use_cases_exists
2713
+ assert(File.file?('./use-cases/README.md'))
2714
+ end
2716
2715
  end