spec/routemaster/api_client_spec.rb in routemaster-drain-2.0.0 vs spec/routemaster/api_client_spec.rb in routemaster-drain-2.2.2

- old
+ new

@@ -30,10 +30,18 @@ body: { id: 132, type: 'widget' }.to_json, headers: { 'content-type' => 'application/json;v=1' } ) + + @patch_req = stub_request(:patch, /example\.com/).to_return( + status: 200, + body: { id: 132, type: 'widget' }.to_json, + headers: { + 'content-type' => 'application/json;v=1' + } + ) end it 'GETs from the URL' do subject expect(@req).to have_been_requested @@ -43,9 +51,18 @@ subject { fetcher.post(url, body: {}, headers: headers) } it 'POSTs from the URL' do subject expect(@post_req).to have_been_requested + end + end + + context 'PATCH request' do + subject { fetcher.patch(url, body: {}, headers: headers) } + + it 'PATCH from the URL' do + subject + expect(@patch_req).to have_been_requested end end it 'has :status, :headers, :body' do expect(subject.status).to eq(200)