aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStormwind <stormwind@stormwinds-page.de>2012-11-23 21:24:37 +0100
committerStormwind <stormwind@stormwinds-page.de>2012-11-23 21:24:37 +0100
commitbffdca6cb18280442996e0c753afe14ca331cad5 (patch)
treec3b357080d5821b6d06a1906f2f471d900eec68e /spec
parentfea8ac2bbd04fd4abea929fef1b7e8ac305b4ca1 (diff)
Delete Content-Length. Conten-Type and body on status 204
Should work, but somehow it doesn't...
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/response/response_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/unit/response/response_spec.rb b/spec/unit/response/response_spec.rb
index 18612ce..7a02ced 100644
--- a/spec/unit/response/response_spec.rb
+++ b/spec/unit/response/response_spec.rb
@@ -45,6 +45,17 @@ describe Zero::Response do
value[1]['Content-Type'].should eq('text/html') # Headers
end
+
+ it "removes Content-Type, Content-Length and body on status code 204" do
+ subject.body.push '"foobar"'
+ subject.content_type 'application/json'
+ subject.header['Content-Length'] = 8
+
+ subject.status = 204
+ value = subject.to_a
+
+ value[1].should eq({}) # Headers
+ end
end
describe '#status' do