Skip to content

Commit 60655e3

Browse files
author
Nathan Sutton
committed
Test that a body is always set with POST and PUT
1 parent 5819eec commit 60655e3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/zencoder/http/net_http_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,23 @@ class Zencoder::HTTP::NetHTTPTest < Test::Unit::TestCase
5454
stub_request(:post, 'https://example.com').with(:body => '{}')
5555
Zencoder::HTTP::NetHTTP.post('https://example.com', :body => '{}')
5656
end
57+
58+
should "POST with an empty body if none is provided" do
59+
stub_request(:post, 'https://example.com').with(:body => '')
60+
Zencoder::HTTP::NetHTTP.post('https://example.com')
61+
end
5762
end
5863

5964
context ".put" do
6065
should "PUT to specified body to the specified path" do
6166
stub_request(:put, 'https://example.com').with(:body => '{}')
6267
Zencoder::HTTP::NetHTTP.put('https://example.com', :body => '{}')
6368
end
69+
70+
should "PUT with an empty body if none is provided" do
71+
stub_request(:put, 'https://example.com').with(:body => '')
72+
Zencoder::HTTP::NetHTTP.put('https://example.com')
73+
end
6474
end
6575

6676
context ".get" do

0 commit comments

Comments
 (0)