|
12 | 12 | let(:accept_encoding) {Protocol::HTTP::AcceptEncoding.new(middleware)} |
13 | 13 |
|
14 | 14 | it "can request resource without compression" do |
15 | | - response = middleware.get("/index") |
| 15 | + response = middleware.call(Protocol::HTTP::Request["GET", "/index"]) |
16 | 16 |
|
17 | 17 | expect(response).to be(:success?) |
18 | 18 | expect(response.headers).not.to have_keys('content-encoding') |
|
22 | 22 | end |
23 | 23 |
|
24 | 24 | it "can request a resource with the identity encoding" do |
25 | | - response = accept_encoding.get("/index", {'accept-encoding' => 'identity'}) |
| 25 | + response = accept_encoding.call(Protocol::HTTP::Request["GET", "/index", {'accept-encoding' => 'identity'}]) |
26 | 26 |
|
27 | 27 | expect(response).to be(:success?) |
28 | 28 | expect(response.headers).not.to have_keys('content-encoding') |
|
32 | 32 | end |
33 | 33 |
|
34 | 34 | it "can request resource with compression" do |
35 | | - response = accept_encoding.get("/index", {'accept-encoding' => 'gzip'}) |
| 35 | + response = accept_encoding.call(Protocol::HTTP::Request["GET", "/index", {'accept-encoding' => 'gzip'}]) |
36 | 36 | expect(response).to be(:success?) |
37 | 37 |
|
38 | 38 | expect(response.headers['vary']).to be(:include?, 'accept-encoding') |
|
52 | 52 | let(:client) {subject.new(app)} |
53 | 53 |
|
54 | 54 | it "can request resource with compression" do |
55 | | - response = client.get("/index", {'accept-encoding' => 'gzip'}) |
| 55 | + response = client.call(Protocol::HTTP::Request["GET", "/index", {'accept-encoding' => 'gzip'}]) |
56 | 56 | expect(response).to be(:success?) |
57 | 57 |
|
58 | 58 | expect(response.headers).not.to have_keys('content-encoding') |
|
70 | 70 | let(:client) {subject.new(app)} |
71 | 71 |
|
72 | 72 | it "does not compress response" do |
73 | | - response = client.get("/index", {'accept-encoding' => 'gzip'}) |
| 73 | + response = client.call(Protocol::HTTP::Request["GET", "/index", {'accept-encoding' => 'gzip'}]) |
74 | 74 |
|
75 | 75 | expect(response).to be(:success?) |
76 | 76 | expect(response.headers).to have_keys('content-encoding') |
|
0 commit comments