http.rb 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +86 -36
- data/Rakefile +4 -4
- data/http.rb.gemspec +8 -7
- data/lib/HTTP/VERSION.rb +1 -1
- data/lib/HTTP/request.rb +1 -1
- data/test/HTTP/RETRY_test.rb +281 -0
- data/test/HTTP/delete_test.rb +265 -0
- data/test/HTTP/get_test.rb +304 -0
- data/{spec/HTTP/head_spec.rb → test/HTTP/head_test.rb} +27 -24
- data/test/HTTP/options_test.rb +246 -0
- data/test/HTTP/patch_test.rb +408 -0
- data/test/HTTP/post_test.rb +448 -0
- data/test/HTTP/put_test.rb +408 -0
- data/test/HTTP/trace_test.rb +246 -0
- data/{spec/spec_helper.rb → test/helper.rb} +15 -2
- metadata +28 -14
- data/spec/HTTP/RETRY_spec.rb +0 -251
- data/spec/HTTP/delete_spec.rb +0 -268
- data/spec/HTTP/get_spec.rb +0 -295
- data/spec/HTTP/options_spec.rb +0 -247
- data/spec/HTTP/patch_spec.rb +0 -406
- data/spec/HTTP/post_spec.rb +0 -447
- data/spec/HTTP/put_spec.rb +0 -406
- data/spec/HTTP/trace_spec.rb +0 -247
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
# test/HTTP/patch_test.rb
|
|
2
|
+
|
|
3
|
+
require_relative '../helper'
|
|
4
|
+
|
|
5
|
+
describe ".patch" do
|
|
6
|
+
describe "with uri-only supplied" do
|
|
7
|
+
before do
|
|
8
|
+
stub_request(:patch, 'http://example.com/path').
|
|
9
|
+
with(headers: {'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Ruby'}).
|
|
10
|
+
to_return(status: 200, body: '', headers: {})
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
describe "uri as a string" do
|
|
14
|
+
let(:uri){'http://example.com/path'}
|
|
15
|
+
|
|
16
|
+
it "creates an instance of URI" do
|
|
17
|
+
received_arg = nil
|
|
18
|
+
parsed_uri = URI.parse(uri)
|
|
19
|
+
URI.stub(:parse, ->(arg){received_arg = arg; parsed_uri}) do
|
|
20
|
+
response = HTTP.patch(uri)
|
|
21
|
+
_(received_arg).must_equal(uri)
|
|
22
|
+
_(response.success?).must_equal(true)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "creates a new Net::HTTP object" do
|
|
27
|
+
received_args = nil
|
|
28
|
+
parsed_uri = URI.parse(uri)
|
|
29
|
+
net_http_object = Net::HTTP.new(parsed_uri.host, parsed_uri.port)
|
|
30
|
+
Net::HTTP.stub(:new, ->(*args){received_args = args; net_http_object}) do
|
|
31
|
+
response = HTTP.patch(uri)
|
|
32
|
+
_(received_args).must_equal([parsed_uri.host, parsed_uri.port])
|
|
33
|
+
_(response.success?).must_equal(true)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
describe "uri as a URI" do
|
|
39
|
+
let(:uri){URI.parse('http://example.com/path')}
|
|
40
|
+
|
|
41
|
+
it "creates a new Net::HTTP object" do
|
|
42
|
+
received_args = nil
|
|
43
|
+
net_http_object = Net::HTTP.new(uri.host, uri.port)
|
|
44
|
+
Net::HTTP.stub(:new, ->(*args){received_args = args; net_http_object}) do
|
|
45
|
+
response = HTTP.patch(uri)
|
|
46
|
+
_(received_args).must_equal([uri.host, uri.port])
|
|
47
|
+
_(response.success?).must_equal(true)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
describe "with form data supplied" do
|
|
54
|
+
let(:uri){'http://example.com/path'}
|
|
55
|
+
let(:parsed_uri){URI.parse(uri)}
|
|
56
|
+
let(:args){{a: 1, b: 2}}
|
|
57
|
+
let(:headers){{'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Ruby'}}
|
|
58
|
+
let(:encoded_form_data){args.x_www_form_urlencode}
|
|
59
|
+
|
|
60
|
+
before do
|
|
61
|
+
stub_request(:patch, 'http://example.com/path').
|
|
62
|
+
with(body: encoded_form_data, headers: headers).
|
|
63
|
+
to_return(status: 200, body: '', headers: {})
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it "sets the form data" do
|
|
67
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
68
|
+
Net::HTTP::Patch.stub(:new, request_object) do
|
|
69
|
+
response = HTTP.patch(uri, args, headers)
|
|
70
|
+
_(request_object.body).must_equal(encoded_form_data)
|
|
71
|
+
_(response.success?).must_equal(true)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
it "creates a new Net::HTTP::Patch object" do
|
|
76
|
+
received_arg = nil
|
|
77
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
78
|
+
Net::HTTP::Patch.stub(:new, ->(arg){received_arg = arg; request_object}) do
|
|
79
|
+
response = HTTP.patch(uri, args, headers)
|
|
80
|
+
_(received_arg).must_equal(parsed_uri.request_uri)
|
|
81
|
+
_(response.success?).must_equal(true)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
describe "with raw form data supplied" do
|
|
87
|
+
let(:uri){'http://example.com/path'}
|
|
88
|
+
let(:parsed_uri){URI.parse(uri)}
|
|
89
|
+
let(:args){{a: 1, b: 2}.x_www_form_urlencode}
|
|
90
|
+
let(:headers){{'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Ruby'}}
|
|
91
|
+
|
|
92
|
+
before do
|
|
93
|
+
stub_request(:patch, 'http://example.com/path').
|
|
94
|
+
with(body: args, headers: headers).
|
|
95
|
+
to_return(status: 200, body: '', headers: {})
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
it "sets the form data" do
|
|
99
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
100
|
+
Net::HTTP::Patch.stub(:new, request_object) do
|
|
101
|
+
response = HTTP.patch(uri, args, headers)
|
|
102
|
+
_(request_object.body).must_equal(args)
|
|
103
|
+
_(response.success?).must_equal(true)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
it "creates a new Net::HTTP::Patch object" do
|
|
108
|
+
received_arg = nil
|
|
109
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
110
|
+
Net::HTTP::Patch.stub(:new, ->(arg){received_arg = arg; request_object}) do
|
|
111
|
+
response = HTTP.patch(uri, args, headers)
|
|
112
|
+
_(received_arg).must_equal(parsed_uri.request_uri)
|
|
113
|
+
_(response.success?).must_equal(true)
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
describe "with JSON data supplied" do
|
|
119
|
+
let(:uri){'http://example.com/path'}
|
|
120
|
+
let(:parsed_uri){URI.parse(uri)}
|
|
121
|
+
let(:args){{a: 1, b: 2}}
|
|
122
|
+
let(:headers){{'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type' => 'application/json', 'User-Agent' => 'Ruby'}}
|
|
123
|
+
let(:json_data){JSON.dump(args)}
|
|
124
|
+
|
|
125
|
+
before do
|
|
126
|
+
stub_request(:patch, 'http://example.com/path').
|
|
127
|
+
with(body: json_data, headers: headers).
|
|
128
|
+
to_return(status: 200, body: '', headers: {})
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
it "sets the body" do
|
|
132
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
133
|
+
Net::HTTP::Patch.stub(:new, request_object) do
|
|
134
|
+
response = HTTP.patch(uri, args, headers)
|
|
135
|
+
_(request_object.body).must_equal(json_data)
|
|
136
|
+
_(response.success?).must_equal(true)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
it "creates a new Net::HTTP::Patch object" do
|
|
141
|
+
received_arg = nil
|
|
142
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
143
|
+
Net::HTTP::Patch.stub(:new, ->(arg){received_arg = arg; request_object}) do
|
|
144
|
+
response = HTTP.patch(uri, args, headers)
|
|
145
|
+
_(received_arg).must_equal(parsed_uri.request_uri)
|
|
146
|
+
_(response.success?).must_equal(true)
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
describe "with raw JSON data supplied" do
|
|
152
|
+
let(:uri){'http://example.com/path'}
|
|
153
|
+
let(:parsed_uri){URI.parse(uri)}
|
|
154
|
+
let(:args){JSON.dump({a: 1, b: 2})}
|
|
155
|
+
let(:headers){{'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type' => 'application/json', 'User-Agent' => 'Ruby'}}
|
|
156
|
+
|
|
157
|
+
before do
|
|
158
|
+
stub_request(:patch, 'http://example.com/path').
|
|
159
|
+
with(body: args, headers: headers).
|
|
160
|
+
to_return(status: 200, body: '', headers: {})
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
it "sets the body" do
|
|
164
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
165
|
+
Net::HTTP::Patch.stub(:new, request_object) do
|
|
166
|
+
response = HTTP.patch(uri, args, headers)
|
|
167
|
+
_(request_object.body).must_equal(args)
|
|
168
|
+
_(response.success?).must_equal(true)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
it "creates a new Net::HTTP::Patch object" do
|
|
173
|
+
received_arg = nil
|
|
174
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
175
|
+
Net::HTTP::Patch.stub(:new, ->(arg){received_arg = arg; request_object}) do
|
|
176
|
+
response = HTTP.patch(uri, args, headers)
|
|
177
|
+
_(received_arg).must_equal(parsed_uri.request_uri)
|
|
178
|
+
_(response.success?).must_equal(true)
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
describe "with headers supplied" do
|
|
184
|
+
let(:uri){'http://example.com/path'}
|
|
185
|
+
let(:parsed_uri){URI.parse(uri)}
|
|
186
|
+
|
|
187
|
+
before do
|
|
188
|
+
stub_request(:patch, 'http://example.com/path').
|
|
189
|
+
with(headers: {'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Minitest'}).
|
|
190
|
+
to_return(status: 200, body: '', headers: {})
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
it "sets the headers on the request object" do
|
|
194
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
195
|
+
Net::HTTP::Patch.stub(:new, request_object) do
|
|
196
|
+
response = HTTP.patch(uri, {}, {'User-Agent' => 'Minitest'})
|
|
197
|
+
_(request_object['User-Agent']).must_equal('Minitest')
|
|
198
|
+
_(response.success?).must_equal(true)
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
describe "when different content-type header key cases are supplied" do
|
|
204
|
+
let(:uri){'http://example.com/path'}
|
|
205
|
+
let(:parsed_uri){URI.parse(uri)}
|
|
206
|
+
let(:args){{a: 1, b: 2}}
|
|
207
|
+
|
|
208
|
+
before do
|
|
209
|
+
stub_request(:patch, 'http://example.com/path').
|
|
210
|
+
with(headers: {'Content-Type' => 'application/json'}).
|
|
211
|
+
to_return(status: 200, body: '', headers: {})
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
describe "title-cased" do
|
|
215
|
+
it "detects the content type" do
|
|
216
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
217
|
+
Net::HTTP::Patch.stub(:new, request_object) do
|
|
218
|
+
HTTP.patch(uri, args, {'Content-Type' => 'application/json'})
|
|
219
|
+
_(request_object['Content-Type']).must_equal('application/json')
|
|
220
|
+
_(request_object.body).must_equal(JSON.dump(args))
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
describe "title-case only at the start" do
|
|
226
|
+
it "detects the content type" do
|
|
227
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
228
|
+
Net::HTTP::Patch.stub(:new, request_object) do
|
|
229
|
+
HTTP.patch(uri, args, {'Content-type' => 'application/json'})
|
|
230
|
+
_(request_object['Content-Type']).must_equal('application/json')
|
|
231
|
+
_(request_object.body).must_equal(JSON.dump(args))
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
describe "lowercase" do
|
|
237
|
+
it "detects the content type" do
|
|
238
|
+
request_object = Net::HTTP::Patch.new(parsed_uri.request_uri)
|
|
239
|
+
Net::HTTP::Patch.stub(:new, request_object) do
|
|
240
|
+
HTTP.patch(uri, args, {'content-type' => 'application/json'})
|
|
241
|
+
_(request_object['Content-Type']).must_equal('application/json')
|
|
242
|
+
_(request_object.body).must_equal(JSON.dump(args))
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
describe "with options supplied" do
|
|
249
|
+
let(:uri){'http://example.com/path'}
|
|
250
|
+
let(:parsed_uri){URI.parse(uri)}
|
|
251
|
+
|
|
252
|
+
before do
|
|
253
|
+
stub_request(:patch, 'https://example.com:80/path').
|
|
254
|
+
with(headers: {'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Ruby'}).
|
|
255
|
+
to_return(status: 200, body: '', headers: {})
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
it "sets the use_ssl option on the Net::HTTP instance" do
|
|
259
|
+
net_http_object = Net::HTTP.new(parsed_uri.host, parsed_uri.port)
|
|
260
|
+
Net::HTTP.stub(:new, net_http_object) do
|
|
261
|
+
response = HTTP.patch(uri, {}, {}, {use_ssl: true})
|
|
262
|
+
_(net_http_object.instance_variable_get(:@use_ssl)).must_equal(true)
|
|
263
|
+
_(response.success?).must_equal(true)
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
describe "with block supplied" do
|
|
269
|
+
let(:uri){'http://example.com/path'}
|
|
270
|
+
|
|
271
|
+
before do
|
|
272
|
+
stub_request(:patch, 'http://example.com/path').
|
|
273
|
+
with(headers: {'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Ruby'}).
|
|
274
|
+
to_return(status: 200, body: '', headers: {})
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
it "yields an instance of Net::HTTPResponse" do
|
|
278
|
+
yielded = nil
|
|
279
|
+
HTTP.patch(uri){|response| yielded = response}
|
|
280
|
+
_(yielded).must_be_kind_of(Net::HTTPResponse)
|
|
281
|
+
end
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
describe "with redirection" do
|
|
285
|
+
let(:request_uri){'http://example.com/path'}
|
|
286
|
+
let(:redirect_uri){'http://redirected.com'}
|
|
287
|
+
|
|
288
|
+
before do
|
|
289
|
+
stub_request(:get, redirect_uri).
|
|
290
|
+
to_return(status: 200, body: '', headers: {})
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
describe "via 301" do
|
|
294
|
+
before do
|
|
295
|
+
stub_request(:patch, request_uri).
|
|
296
|
+
to_return(status: 301, headers: {'location' => redirect_uri})
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
it "follows the redirect with GET" do
|
|
300
|
+
response = HTTP.patch(request_uri)
|
|
301
|
+
_(response.success?).must_equal(true)
|
|
302
|
+
assert_requested(:patch, request_uri)
|
|
303
|
+
assert_requested(:get, redirect_uri)
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
describe "via 302" do
|
|
308
|
+
before do
|
|
309
|
+
stub_request(:patch, request_uri).
|
|
310
|
+
to_return(status: 302, headers: {'location' => redirect_uri})
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
it "follows the redirect with GET" do
|
|
314
|
+
response = HTTP.patch(request_uri)
|
|
315
|
+
_(response.success?).must_equal(true)
|
|
316
|
+
assert_requested(:patch, request_uri)
|
|
317
|
+
assert_requested(:get, redirect_uri)
|
|
318
|
+
end
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
describe "with path only redirection" do
|
|
323
|
+
let(:request_uri){'http://example.com/path'}
|
|
324
|
+
let(:redirect_path){'/new_path'}
|
|
325
|
+
let(:redirect_uri){"http://example.com#{redirect_path}"}
|
|
326
|
+
|
|
327
|
+
before do
|
|
328
|
+
stub_request(:get, redirect_uri).
|
|
329
|
+
to_return(status: 200, body: '', headers: {})
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
describe "via 301" do
|
|
333
|
+
before do
|
|
334
|
+
stub_request(:patch, request_uri).
|
|
335
|
+
to_return(status: 301, headers: {'location' => redirect_path})
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
it "resolves the relative redirect against the original URI" do
|
|
339
|
+
response = HTTP.patch(request_uri)
|
|
340
|
+
_(response.success?).must_equal(true)
|
|
341
|
+
assert_requested(:get, redirect_uri)
|
|
342
|
+
end
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
describe "via 302" do
|
|
346
|
+
before do
|
|
347
|
+
stub_request(:patch, request_uri).
|
|
348
|
+
to_return(status: 302, headers: {'location' => redirect_path})
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
it "resolves the relative redirect against the original URI" do
|
|
352
|
+
response = HTTP.patch(request_uri)
|
|
353
|
+
_(response.success?).must_equal(true)
|
|
354
|
+
assert_requested(:get, redirect_uri)
|
|
355
|
+
end
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
describe "with verb-preserving redirection via 307" do
|
|
360
|
+
let(:request_uri){'http://example.com/path'}
|
|
361
|
+
let(:redirect_uri){'http://redirected.com'}
|
|
362
|
+
|
|
363
|
+
before do
|
|
364
|
+
stub_request(:patch, request_uri).
|
|
365
|
+
to_return(status: 307, headers: {'location' => redirect_uri})
|
|
366
|
+
stub_request(:patch, redirect_uri).
|
|
367
|
+
to_return(status: 200, body: '', headers: {})
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
it "preserves the verb" do
|
|
371
|
+
response = HTTP.patch(request_uri)
|
|
372
|
+
_(response.success?).must_equal(true)
|
|
373
|
+
assert_requested(:patch, request_uri)
|
|
374
|
+
assert_requested(:patch, redirect_uri)
|
|
375
|
+
end
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
describe "no_redirect true" do
|
|
379
|
+
let(:request_uri){'http://example.com/path'}
|
|
380
|
+
let(:redirect_uri){'http://redirected.com'}
|
|
381
|
+
|
|
382
|
+
describe "via 301" do
|
|
383
|
+
before do
|
|
384
|
+
stub_request(:patch, request_uri).
|
|
385
|
+
to_return(status: 301, headers: {'location' => redirect_uri})
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
it "returns the redirect response without following it" do
|
|
389
|
+
response = HTTP.patch(request_uri, {}, {}, {no_redirect: true})
|
|
390
|
+
_(response.redirection?).must_equal(true)
|
|
391
|
+
assert_not_requested(:get, redirect_uri)
|
|
392
|
+
end
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
describe "via 302" do
|
|
396
|
+
before do
|
|
397
|
+
stub_request(:patch, request_uri).
|
|
398
|
+
to_return(status: 302, headers: {'location' => redirect_uri})
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
it "returns the redirect response without following it" do
|
|
402
|
+
response = HTTP.patch(request_uri, {}, {}, {no_redirect: true})
|
|
403
|
+
_(response.redirection?).must_equal(true)
|
|
404
|
+
assert_not_requested(:get, redirect_uri)
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
end
|
|
408
|
+
end
|