@@ -37,7 +37,7 @@ def test_raises_on_missing_non_nullable_opts
3737 def test_client_default_request_default_retry_attempts
3838 stub_request ( :post , "http://localhost/api/v4/leads/unsorted/forms" ) . to_return_json ( status : 500 , body : { } )
3939
40- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
40+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
4141
4242 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
4343 amocrm . v4 . leads . unsorted . create_forms (
@@ -51,7 +51,13 @@ def test_client_default_request_default_retry_attempts
5151 def test_client_given_request_default_retry_attempts
5252 stub_request ( :post , "http://localhost/api/v4/leads/unsorted/forms" ) . to_return_json ( status : 500 , body : { } )
5353
54- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key" , max_retries : 3 )
54+ amocrm =
55+ Amocrm ::Client . new (
56+ base_url : "http://localhost" ,
57+ token : "My Token" ,
58+ subdomain : "My-Subdomain" ,
59+ max_retries : 3
60+ )
5561
5662 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
5763 amocrm . v4 . leads . unsorted . create_forms (
@@ -65,7 +71,7 @@ def test_client_given_request_default_retry_attempts
6571 def test_client_default_request_given_retry_attempts
6672 stub_request ( :post , "http://localhost/api/v4/leads/unsorted/forms" ) . to_return_json ( status : 500 , body : { } )
6773
68- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
74+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
6975
7076 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
7177 amocrm . v4 . leads . unsorted . create_forms (
@@ -80,7 +86,13 @@ def test_client_default_request_given_retry_attempts
8086 def test_client_given_request_given_retry_attempts
8187 stub_request ( :post , "http://localhost/api/v4/leads/unsorted/forms" ) . to_return_json ( status : 500 , body : { } )
8288
83- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key" , max_retries : 3 )
89+ amocrm =
90+ Amocrm ::Client . new (
91+ base_url : "http://localhost" ,
92+ token : "My Token" ,
93+ subdomain : "My-Subdomain" ,
94+ max_retries : 3
95+ )
8496
8597 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
8698 amocrm . v4 . leads . unsorted . create_forms (
@@ -99,7 +111,13 @@ def test_client_retry_after_seconds
99111 body : { }
100112 )
101113
102- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key" , max_retries : 1 )
114+ amocrm =
115+ Amocrm ::Client . new (
116+ base_url : "http://localhost" ,
117+ token : "My Token" ,
118+ subdomain : "My-Subdomain" ,
119+ max_retries : 1
120+ )
103121
104122 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
105123 amocrm . v4 . leads . unsorted . create_forms (
@@ -118,7 +136,13 @@ def test_client_retry_after_date
118136 body : { }
119137 )
120138
121- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key" , max_retries : 1 )
139+ amocrm =
140+ Amocrm ::Client . new (
141+ base_url : "http://localhost" ,
142+ token : "My Token" ,
143+ subdomain : "My-Subdomain" ,
144+ max_retries : 1
145+ )
122146
123147 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
124148 Thread . current . thread_variable_set ( :time_now , Time . now )
@@ -139,7 +163,13 @@ def test_client_retry_after_ms
139163 body : { }
140164 )
141165
142- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key" , max_retries : 1 )
166+ amocrm =
167+ Amocrm ::Client . new (
168+ base_url : "http://localhost" ,
169+ token : "My Token" ,
170+ subdomain : "My-Subdomain" ,
171+ max_retries : 1
172+ )
143173
144174 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
145175 amocrm . v4 . leads . unsorted . create_forms (
@@ -154,7 +184,7 @@ def test_client_retry_after_ms
154184 def test_retry_count_header
155185 stub_request ( :post , "http://localhost/api/v4/leads/unsorted/forms" ) . to_return_json ( status : 500 , body : { } )
156186
157- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
187+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
158188
159189 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
160190 amocrm . v4 . leads . unsorted . create_forms (
@@ -170,7 +200,7 @@ def test_retry_count_header
170200 def test_omit_retry_count_header
171201 stub_request ( :post , "http://localhost/api/v4/leads/unsorted/forms" ) . to_return_json ( status : 500 , body : { } )
172202
173- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
203+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
174204
175205 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
176206 amocrm . v4 . leads . unsorted . create_forms (
@@ -187,7 +217,7 @@ def test_omit_retry_count_header
187217 def test_overwrite_retry_count_header
188218 stub_request ( :post , "http://localhost/api/v4/leads/unsorted/forms" ) . to_return_json ( status : 500 , body : { } )
189219
190- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
220+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
191221
192222 assert_raises ( Amocrm ::Errors ::InternalServerError ) do
193223 amocrm . v4 . leads . unsorted . create_forms (
@@ -210,7 +240,7 @@ def test_client_redirect_307
210240 headers : { "location" => "/redirected" }
211241 )
212242
213- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
243+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
214244
215245 assert_raises ( Amocrm ::Errors ::APIConnectionError ) do
216246 amocrm . v4 . leads . unsorted . create_forms (
@@ -242,7 +272,7 @@ def test_client_redirect_303
242272 headers : { "location" => "/redirected" }
243273 )
244274
245- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
275+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
246276
247277 assert_raises ( Amocrm ::Errors ::APIConnectionError ) do
248278 amocrm . v4 . leads . unsorted . create_forms (
@@ -269,7 +299,7 @@ def test_client_redirect_auth_keep_same_origin
269299 headers : { "location" => "/redirected" }
270300 )
271301
272- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
302+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
273303
274304 assert_raises ( Amocrm ::Errors ::APIConnectionError ) do
275305 amocrm . v4 . leads . unsorted . create_forms (
@@ -299,7 +329,7 @@ def test_client_redirect_auth_strip_cross_origin
299329 headers : { "location" => "https://example.com/redirected" }
300330 )
301331
302- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
332+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
303333
304334 assert_raises ( Amocrm ::Errors ::APIConnectionError ) do
305335 amocrm . v4 . leads . unsorted . create_forms (
@@ -317,7 +347,7 @@ def test_client_redirect_auth_strip_cross_origin
317347 def test_default_headers
318348 stub_request ( :post , "http://localhost/api/v4/leads/unsorted/forms" ) . to_return_json ( status : 200 , body : { } )
319349
320- amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , api_key : "My API Key " )
350+ amocrm = Amocrm ::Client . new ( base_url : "http://localhost" , token : "My Token" , subdomain : "My-Subdomain ")
321351
322352 amocrm . v4 . leads . unsorted . create_forms (
323353 body : [ { metadata : { } , source_name : "source_name" , source_uid : "source_uid" } ]
0 commit comments