Skip to content

Commit 3a8b250

Browse files
committed
spec for 201 response with empty body - should return content-length set
to 0
1 parent be0cd9b commit 3a8b250

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
require 'spec_helper'
2+
3+
class Empty < Goliath::API
4+
def response(env)
5+
[201, {}, []]
6+
end
7+
end
8+
9+
describe 'Empty body API' do
10+
it 'serves a 201 with no body' do
11+
with_api(Empty) do
12+
http = EM::HttpRequest.new('http://localhost:9000').get
13+
http.errback { fail }
14+
http.callback do |c|
15+
c.response_header.status.should == 201
16+
c.response_header['CONTENT_LENGTH'].should == '0'
17+
stop
18+
end
19+
end
20+
end
21+
end

0 commit comments

Comments
 (0)