diff options
author | Stormwind <stormwind@stormwinds-page.de> | 2012-11-23 19:39:56 +0100 |
---|---|---|
committer | Stormwind <stormwind@stormwinds-page.de> | 2012-11-23 19:39:56 +0100 |
commit | 78121c6eea9cc6d2a669c93f0b89557b5c59babc (patch) | |
tree | c494118faf6ff793a9ebe352cbf81360f7428040 /spec | |
parent | c15e8bdacb5d85b5ccfd154015473674fa8971dc (diff) |
Sets the Content-Length in to_a unless it is already set before
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/response/response_spec.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/unit/response/response_spec.rb b/spec/unit/response/response_spec.rb index 9f6a3a0..b6428fc 100644 --- a/spec/unit/response/response_spec.rb +++ b/spec/unit/response/response_spec.rb @@ -19,12 +19,19 @@ describe Zero::Response do end it "returns the content length in the header" do - subject.body = ['foobar'] - + subject.body = ['foobar'] value = subject.to_a value[1].should eq({'Content-Length' => 6}) # Headers end + + it "does not fix the Content-Length, if it's already set" do + subject.body = ['foobar'] + subject.header = {'Content-Length' => 3} + value = subject.to_a + + value[1].should eq({'Content-Length' => 3}) # Headers + end end describe '#status' do |