From 5c899df07753a31543f8dad725a26ccddc44dfe2 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Mon, 13 Mar 2023 19:48:40 -0600 Subject: Añade método update a UserAccountsController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/support/shared_examples/requests/put_request.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'spec/support/shared_examples/requests') 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 -- cgit v1.2.3