aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStormwind <stormwind@stormwinds-page.de>2012-11-23 18:06:53 +0100
committerStormwind <stormwind@stormwinds-page.de>2012-11-23 18:06:53 +0100
commita2e6c299cd15b8335441e3b5ba07fe95256f3a2d (patch)
treeb42ef45756a008c37171bbef93c2795cbde86344 /spec
parentb4e56c6868125af8e5c773140da0775a831779d2 (diff)
Sets Content-Length to body string bytesize
Sets the Conten-Length to the bytesize of the joined body to cover UTF-8
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/response/response_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/response/response_spec.rb b/spec/unit/response/response_spec.rb
index 21d6e31..e58b0d0 100644
--- a/spec/unit/response/response_spec.rb
+++ b/spec/unit/response/response_spec.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
require 'spec_helper'
describe Zero::Response do
@@ -60,6 +61,13 @@ describe Zero::Response do
subject.header['Content-Length'].should eq(6)
end
+
+ it "sets the content_length to the bytesize of the message body" do
+ subject.body = ['föö', 'bär']
+ subject.content_length
+
+ subject.header['Content-Length'].should eq(9)
+ end
end
end \ No newline at end of file