1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

Calling Payload::Base.to_s returns empty on the second call

This commit is contained in:
Pedro Chambino 2014-04-01 19:46:20 +01:00
parent 0037bf373b
commit a200e4facf

View file

@ -3,6 +3,14 @@
require 'spec_helper' require 'spec_helper'
describe RestClient::Payload do describe RestClient::Payload do
context "Base Payload" do
it "should reset stream after to_s" do
payload = RestClient::Payload::Base.new('foobar')
payload.to_s.should eq 'foobar'
payload.to_s.should eq 'foobar'
end
end
context "A regular Payload" do context "A regular Payload" do
it "should use standard enctype as default content-type" do it "should use standard enctype as default content-type" do
RestClient::Payload::UrlEncoded.new({}).headers['Content-Type']. RestClient::Payload::UrlEncoded.new({}).headers['Content-Type'].