Sha256: 56a283abad78772a03efdfdc511610f78542b7648b65ccb6aa4ff7f88f76413c
Contents?: true
Size: 1.14 KB
Versions: 12
Compression:
Stored size: 1.14 KB
Contents
require 'spec_helper' describe 'client requester' do before do allow(RestClient).to receive(:send) RSpec::Mocks.space.proxy_for(self).remove_stub_if_present(:get) end after do allow(RestClient).to receive(:send).and_call_original Airborne.configure { |config| config.headers = {} } end it 'should set :content_type to :json by default' do get '/foo' expect(RestClient).to have_received(:send) .with(:get, 'http://www.example.com/foo', { content_type: :json }) end it 'should override headers with option[:headers]' do get '/foo', { content_type: 'application/x-www-form-urlencoded' } expect(RestClient).to have_received(:send) .with(:get, 'http://www.example.com/foo', { content_type: 'application/x-www-form-urlencoded' }) end it 'should override headers with airborne config headers' do Airborne.configure { |config| config.headers = { content_type: 'text/plain' } } get '/foo' expect(RestClient).to have_received(:send) .with(:get, 'http://www.example.com/foo', { content_type: 'text/plain' }) end end
Version data entries
12 entries across 12 versions & 1 rubygems