|
3 | 3 | describe ApiAuth::RequestDrivers::RestClientRequest do |
4 | 4 | let(:timestamp) { Time.now.utc.httpdate } |
5 | 5 |
|
6 | | - let(:request_path) { 'http://localhost/resource.xml?foo=bar&bar=foo' } |
| 6 | + let(:request_path) { 'https://localhost/resource.xml?foo=bar&bar=foo' } |
7 | 7 |
|
8 | 8 | let(:request_headers) do |
9 | 9 | { |
|
16 | 16 |
|
17 | 17 | let(:request) do |
18 | 18 | RestClient::Request.new( |
19 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 19 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
20 | 20 | headers: request_headers, |
21 | 21 | method: :put, |
22 | 22 | payload: "hello\nworld" |
|
35 | 35 | end |
36 | 36 |
|
37 | 37 | it 'gets the request_uri' do |
38 | | - expect(driven_request.request_uri).to eq('http://localhost/resource.xml?foo=bar&bar=foo') |
| 38 | + expect(driven_request.request_uri).to eq('https://localhost/resource.xml?foo=bar&bar=foo') |
39 | 39 | end |
40 | 40 |
|
41 | 41 | it 'gets the timestamp' do |
|
53 | 53 |
|
54 | 54 | it 'treats no body as empty string' do |
55 | 55 | request = RestClient::Request.new( |
56 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 56 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
57 | 57 | headers: request_headers, |
58 | 58 | method: :put |
59 | 59 | ) |
|
66 | 66 | context 'when put request' do |
67 | 67 | let(:request) do |
68 | 68 | RestClient::Request.new( |
69 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 69 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
70 | 70 | headers: request_headers, |
71 | 71 | method: :put |
72 | 72 | ) |
|
80 | 80 | context 'when get request' do |
81 | 81 | let(:request) do |
82 | 82 | RestClient::Request.new( |
83 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 83 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
84 | 84 | headers: request_headers, |
85 | 85 | method: :get |
86 | 86 | ) |
|
104 | 104 | context 'when getting' do |
105 | 105 | let(:request) do |
106 | 106 | RestClient::Request.new( |
107 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 107 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
108 | 108 | headers: request_headers, |
109 | 109 | method: :get |
110 | 110 | ) |
|
119 | 119 | context 'when posting' do |
120 | 120 | let(:request) do |
121 | 121 | RestClient::Request.new( |
122 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 122 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
123 | 123 | headers: request_headers, |
124 | 124 | method: :post, |
125 | 125 | payload: "hello\nworld" |
|
140 | 140 | context 'when putting' do |
141 | 141 | let(:request) do |
142 | 142 | RestClient::Request.new( |
143 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 143 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
144 | 144 | headers: request_headers, |
145 | 145 | method: :put, |
146 | 146 | payload: "hello\nworld" |
|
161 | 161 | context 'when deleting' do |
162 | 162 | let(:request) do |
163 | 163 | RestClient::Request.new( |
164 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 164 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
165 | 165 | headers: request_headers, |
166 | 166 | method: :delete |
167 | 167 | ) |
|
203 | 203 | context 'when getting' do |
204 | 204 | let(:request) do |
205 | 205 | RestClient::Request.new( |
206 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 206 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
207 | 207 | headers: request_headers, |
208 | 208 | method: :get |
209 | 209 | ) |
|
217 | 217 | context 'when posting' do |
218 | 218 | let(:request) do |
219 | 219 | RestClient::Request.new( |
220 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 220 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
221 | 221 | headers: request_headers, |
222 | 222 | method: :post, |
223 | 223 | payload: "hello\nworld" |
|
258 | 258 | context 'when putting' do |
259 | 259 | let(:request) do |
260 | 260 | RestClient::Request.new( |
261 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 261 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
262 | 262 | headers: request_headers, |
263 | 263 | method: :put, |
264 | 264 | payload: "hello\nworld" |
|
299 | 299 | context 'when deleting' do |
300 | 300 | let(:request) do |
301 | 301 | RestClient::Request.new( |
302 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 302 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
303 | 303 | headers: request_headers, |
304 | 304 | method: :delete |
305 | 305 | ) |
|
315 | 315 | context 'when getting' do |
316 | 316 | let(:request) do |
317 | 317 | RestClient::Request.new( |
318 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 318 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
319 | 319 | method: :get |
320 | 320 | ) |
321 | 321 | end |
|
332 | 332 | context 'when posting' do |
333 | 333 | let(:request) do |
334 | 334 | RestClient::Request.new( |
335 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 335 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
336 | 336 | method: :post, |
337 | 337 | payload: "hello\nworld" |
338 | 338 | ) |
|
350 | 350 | context 'when putting' do |
351 | 351 | let(:request) do |
352 | 352 | RestClient::Request.new( |
353 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 353 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
354 | 354 | method: :put, |
355 | 355 | payload: "hello\nworld" |
356 | 356 | ) |
|
368 | 368 | context 'when deleting' do |
369 | 369 | let(:request) do |
370 | 370 | RestClient::Request.new( |
371 | | - url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 371 | + url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
372 | 372 | method: :delete |
373 | 373 | ) |
374 | 374 | end |
|
388 | 388 | headers = { 'X-Authorization-Content-SHA256' => 'e59ff97941044f85df5297e1c302d260', |
389 | 389 | :content_type => 'text/plain', |
390 | 390 | 'Date' => 'Mon, 23 Jan 1984 03:29:56 GMT' } |
391 | | - request = RestClient::Request.new(url: 'http://localhost/resource.xml?foo=bar&bar=foo', |
| 391 | + request = RestClient::Request.new(url: 'https://localhost/resource.xml?foo=bar&bar=foo', |
392 | 392 | headers: headers, |
393 | 393 | method: :put) |
394 | 394 | ApiAuth.sign!(request, 'some access id', 'some secret key') |
|
0 commit comments