spec/groupdocs/api/helpers/rest_helper_spec.rb in groupdocs-0.3.11 vs spec/groupdocs/api/helpers/rest_helper_spec.rb in groupdocs-1.0.0
- old
+ new
@@ -77,9 +77,18 @@
subject.options[:request_body] = { body: 'test' }
lambda do
subject.send(:prepare_request)
end.should change { subject.options[:headers][:content_type] }.to('application/json')
end
+
+ it 'allows sending payload as plain text' do
+ subject.options[:method] = :POST
+ subject.options[:request_body] = 'test'
+ subject.options[:plain] = true
+ subject.send(:prepare_request)
+ subject.options[:request_body].should == 'test'
+ subject.options[:headers][:content_type].should_not == 'application/json'
+ end
end
describe '#send_request' do
%w(GET DOWNLOAD POST PUT DELETE).each do |method|
it "sends HTTP #{method} request" do