diff --git a/test/sendgrid/test_sendgrid-ruby.rb b/test/sendgrid/test_sendgrid-ruby.rb index fd4d6e4e..8fe01547 100644 --- a/test/sendgrid/test_sendgrid-ruby.rb +++ b/test/sendgrid/test_sendgrid-ruby.rb @@ -44,17 +44,20 @@ def test_init_when_impersonate_subuser_is_not_given end def test_init_when_http_options_is_given + params = JSON.parse('{"subuser": "test_string", "ip": "test_string", "limit": 1, "exclude_whitelabels": "true", "offset": 1}') headers = JSON.parse('{"X-Mock": 200}') http_options = { open_timeout: 40, read_timeout: 40 } - sg = SendGrid::API.new(api_key: 'SENDGRID_API_KEY', host: 'https://api.test.com', request_headers: headers, version: 'v3', http_options: http_options) - sg.client.get + sg = SendGrid::API.new(api_key: 'SENDGRID_API_KEY', version: 'v3', http_options: http_options) + client = sg.client.ips + response = client.get(query_params: params, request_headers: headers) - assert_equal(40, sg.client.http.open_timeout) - assert_equal(40, sg.client.http.read_timeout) + assert_equal(40, client.http.open_timeout) + assert_equal(40, client.http.read_timeout) + assert_equal('200', response.status_code) end def test_access_settings_activity_get