summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared_examples/requests/delete_request.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/support/shared_examples/requests/delete_request.rb b/spec/support/shared_examples/requests/delete_request.rb
index ea921ea..caeaae0 100644
--- a/spec/support/shared_examples/requests/delete_request.rb
+++ b/spec/support/shared_examples/requests/delete_request.rb
@@ -1,5 +1,17 @@
# frozen_string_literal: true
RSpec.shared_examples 'a DELETE request' do
- let(:headers) { { 'CONTENT_TYPE' => 'application/json' } }
+ 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