# frozen_string_literal: true RSpec.shared_examples 'a DELETE request' do context 'for an existing resource' do it 'deletes the resource' do delete(resource, headers:) expect(response).to have_http_status(303) end end context 'for a non-existent resource' do it 'returns a 404 http status' do delete(nonexistent_resource, headers:) expect(response).to have_http_status(404) end end end