0
0
Fork 0

Sets Content-Type header in to_a

This commit is contained in:
Stormwind 2012-11-23 19:35:14 +01:00
parent 406c6f88d3
commit c15e8bdacb
2 changed files with 7 additions and 1 deletions

View File

@ -33,6 +33,7 @@ module Zero
def to_a()
# TODO Remove content length and body, on certain status codes
# TODO Set content length, if not already set
content_length
# TODO Set content type, if not already set
[status, header, body]

View File

@ -14,11 +14,16 @@ describe Zero::Response do
value.should be_an_instance_of(Array)
value[0].should eq(200) # Status code
value[1].should eq({}) # Headers
value[1].should eq({"Content-Length" => 0}) # Headers
value[2].should eq([]) # Body
end
it "returns the content length in the header" do
subject.body = ['foobar']
value = subject.to_a
value[1].should eq({'Content-Length' => 6}) # Headers
end
end