summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/requests/delete_request.rb
blob: 95d516e9ba6249c7687e769fdf89b7462ee8c66e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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(204)
    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