spec/mongrel2/httpresponse_spec.rb in mongrel2-0.26.0 vs spec/mongrel2/httpresponse_spec.rb in mongrel2-0.27.0
- old
+ new
@@ -53,11 +53,11 @@
end
it "returns an empty response if its status is set to NO_CONTENT" do
@response.puts "The response body"
@response.status = HTTP::NO_CONTENT
- @response.header_data.should =~ /Content-length: 0/i
+ @response.header_data.should_not =~ /Content-length/i
@response.header_data.should_not =~ /Content-type/i
@response.to_s.should_not =~ /The response body/i
end
it "sets Date, Content-type, and Content-length headers automatically if they haven't been set" do
@@ -67,12 +67,13 @@
@response.header_data.should =~ /Content-length: 11/i
@response.header_data.should =~ /Date: #{HTTP_DATE}/i
end
it "re-calculates the automatically-added headers when re-rendered" do
- @response.header_data.should =~ /Content-length: 0/i
+ @response.header_data.should =~ /Content-length: 0\b/i
+ @response.status = HTTP::OK
@response << "More data!"
- @response.header_data.should =~ /Content-length: 10/i
+ @response.header_data.should =~ /Content-length: 10\b/i
end
it "doesn't have a body" do
@response.body.size.should == 0
end