aboutsummaryrefslogtreecommitdiff
path: root/spec/unit/response/response_spec.rb
diff options
context:
space:
mode:
authorStormwind <stormwind@stormwinds-page.de>2012-11-23 17:59:33 +0100
committerStormwind <stormwind@stormwinds-page.de>2012-11-23 17:59:33 +0100
commitb4e56c6868125af8e5c773140da0775a831779d2 (patch)
treeb29d4ad889b91a059493b5031e4ee0d7082b2bd3 /spec/unit/response/response_spec.rb
parent22cf93d0027190c10ee24372dd2d35ce87fd6d84 (diff)
Sets Content-Length to body string length
It joins the body array to a string and sets the Content-Length header to its length.
Diffstat (limited to 'spec/unit/response/response_spec.rb')
-rw-r--r--spec/unit/response/response_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/response/response_spec.rb b/spec/unit/response/response_spec.rb
index 0bb0c4e..21d6e31 100644
--- a/spec/unit/response/response_spec.rb
+++ b/spec/unit/response/response_spec.rb
@@ -53,6 +53,13 @@ describe Zero::Response do
subject.header['Content-Length'].should eq(0)
end
+
+ it "sets the content_length to the size of the message body" do
+ subject.body = ['foo', 'bar']
+ subject.content_length
+
+ subject.header['Content-Length'].should eq(6)
+ end
end
end \ No newline at end of file