Sets Content-Type header in to_a
This commit is contained in:
parent
406c6f88d3
commit
c15e8bdacb
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue