spec/routemaster/resources/rest_resource_spec.rb in routemaster-drain-2.3.0 vs spec/routemaster/resources/rest_resource_spec.rb in routemaster-drain-2.4.0
- old
+ new
@@ -8,26 +8,28 @@
let(:client) { double('Client') }
let(:params) { {} }
subject { described_class.new(url, client: client) }
+ before { allow(client).to receive(:with_response).and_yield }
+
describe '#create' do
it 'posts to the given url' do
expect(client).to receive(:post).with(url, body: params)
subject.create(params)
end
end
describe '#show' do
it 'gets to the given url' do
- expect(client).to receive(:get).with(url)
+ expect(client).to receive(:get).with(url, options: { enable_caching: true })
subject.show(1)
end
end
describe '#index' do
it 'gets to the given url' do
- expect(client).to receive(:get).with(url)
+ expect(client).to receive(:get).with(url, params: {}, options: { enable_caching: false })
subject.index
end
end
describe '#update' do