spec/unit/response_spec.rb in restfulness-0.2.6 vs spec/unit/response_spec.rb in restfulness-0.3.0
- old
+ new
@@ -38,12 +38,12 @@
request.stub(:route).and_return(nil)
request.stub(:uri).and_return(URI('http://test.com/test'))
obj.run
obj.status.should eql(404)
obj.payload.should be_empty
- obj.headers['Content-Type'].should match(/text\/plain/)
- obj.headers['Content-Length'].should eql(0.to_s)
+ obj.headers['Content-Type'].should be_nil
+ obj.headers['Content-Length'].should be_nil
end
end
context "with route" do
let :route do
app.router.routes.first
@@ -73,10 +73,11 @@
resource.should_receive(:check_callbacks)
resource.should_receive(:call).and_return(nil)
route.stub(:build_resource).and_return(resource)
obj.run
obj.status.should eql(204)
- obj.headers['Content-Type'].should match(/text\/plain/)
+ obj.headers['Content-Type'].should be_nil
+ obj.headers['Content-Length'].should be_nil
end
it "should set string content type if payload is a string" do
request.stub(:route).and_return(route)
request.action = :get