summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/requests/delete_request.rb
blob: caeaae060bf681d8b19454454107ba4575b90e87 (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(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