spec/bullet/rack_spec.rb in bullet-5.2.0 vs spec/bullet/rack_spec.rb in bullet-5.2.1
- old
+ new
@@ -58,39 +58,39 @@
context "#call" do
context "when Bullet is enabled" do
it "should return original response body" do
expected_response = Support::ResponseDouble.new "Actual body"
app.response = expected_response
- _, _, response = middleware.call([])
+ _, _, response = middleware.call({})
expect(response).to eq(expected_response)
end
it "should change response body if notification is active" do
expect(Bullet).to receive(:notification?).and_return(true)
expect(Bullet).to receive(:gather_inline_notifications).and_return("<bullet></bullet>")
expect(Bullet).to receive(:perform_out_of_channel_notifications)
- status, headers, response = middleware.call([200, {"Content-Type" => "text/html"}])
+ status, headers, response = middleware.call({"Content-Type" => "text/html"})
expect(headers["Content-Length"]).to eq("56")
expect(response).to eq(["<html><head></head><body><bullet></bullet></body></html>"])
end
it "should set the right Content-Length if response body contains accents" do
response = Support::ResponseDouble.new
response.body = "<html><head></head><body>é</body></html>"
app.response = response
expect(Bullet).to receive(:notification?).and_return(true)
expect(Bullet).to receive(:gather_inline_notifications).and_return("<bullet></bullet>")
- status, headers, response = middleware.call([200, {"Content-Type" => "text/html"}])
+ status, headers, response = middleware.call({"Content-Type" => "text/html"})
expect(headers["Content-Length"]).to eq("58")
end
end
context "when Bullet is disabled" do
before(:each) { allow(Bullet).to receive(:enable?).and_return(false) }
it "should not call Bullet.start_request" do
expect(Bullet).not_to receive(:start_request)
- middleware.call([])
+ middleware.call({})
end
end
end
describe "#response_body" do