summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples')
-rw-r--r--spec/support/shared_examples/requests/put_request.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/support/shared_examples/requests/put_request.rb b/spec/support/shared_examples/requests/put_request.rb
index 9e46235..d329b78 100644
--- a/spec/support/shared_examples/requests/put_request.rb
+++ b/spec/support/shared_examples/requests/put_request.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-RSpec.shared_examples 'a PUT request' do
+RSpec.shared_examples 'a PUT request' do |account: false|
context 'with correct parameters' do
it 'returns a successful http status and a response with the putted data' do
put(route, params:, headers:)
@@ -17,10 +17,12 @@ RSpec.shared_examples 'a PUT request' do
end
end
- context 'to an nonexistent resource' do
- it 'returns a 404 status' do
- put(wrong_route, params:, headers:)
- expect(response).to have_http_status(404)
+ if account
+ context 'to an nonexistent resource' do
+ it 'returns a 404 status' do
+ put(wrong_route, params:, headers:)
+ expect(response).to have_http_status(404)
+ end
end
end
end