Sha256: d343d2b35ad9733988dbfd2bde3bd1675d34a39d202e450e2a2fe52050a53540
Contents?: true
Size: 631 Bytes
Versions: 34
Compression:
Stored size: 631 Bytes
Contents
require 'rails_helper' RSpec.describe "<%= type %>#destroy", type: :request do subject(:make_request) do jsonapi_delete "<%= api_namespace %>/<%= type %>/#{<%= var %>.id}" end describe 'basic destroy' do let!(:<%= var %>) { create(:<%= var %>) } it 'updates the resource' do expect(<%= resource_class %>).to receive(:find).and_call_original expect { make_request }.to change { <%= model_class %>.count }.by(-1) expect { <%= var %>.reload } .to raise_error(ActiveRecord::RecordNotFound) expect(response.status).to eq(200) expect(json).to eq('meta' => {}) end end end
Version data entries
34 entries across 34 versions & 1 rubygems