Skip to content

Commit 7d42378

Browse files
Refactor test for http_options
1 parent 6757832 commit 7d42378

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/sendgrid/test_sendgrid-ruby.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,19 @@ def test_init_when_impersonate_subuser_is_not_given
4444
end
4545

4646
def test_init_when_http_options_is_given
47+
params = JSON.parse('{"subuser": "test_string", "ip": "test_string", "limit": 1, "exclude_whitelabels": "true", "offset": 1}')
4748
headers = JSON.parse('{"X-Mock": 200}')
4849
http_options = {
4950
open_timeout: 40,
5051
read_timeout: 40
5152
}
5253

53-
sg = SendGrid::API.new(api_key: 'SENDGRID_API_KEY', host: 'https://api.test.com', request_headers: headers, version: 'v3', http_options: http_options)
54-
sg.client.get
54+
sg = SendGrid::API.new(api_key: 'SENDGRID_API_KEY', version: 'v3', http_options: http_options)
55+
client = sg.client.ips
56+
response = client.get(query_params: params, request_headers: headers)
5557

56-
assert_equal(40, sg.client.http.open_timeout)
57-
assert_equal(40, sg.client.http.read_timeout)
58+
assert_equal(40, client.http.open_timeout)
59+
assert_equal(40, client.http.read_timeout)
5860
end
5961

6062
def test_access_settings_activity_get

0 commit comments

Comments
 (0)