From ff51f7b6ad27f1e52e49157e47e15ca4235f4967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Leli=C3=A8vre?= Date: Thu, 19 Dec 2024 11:53:05 +0100 Subject: [PATCH] rubocop --- spec/acceptance/api/v1/requests_controller_spec.rb | 3 +-- spec/requests/api/v1/requests_spec.rb | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/acceptance/api/v1/requests_controller_spec.rb b/spec/acceptance/api/v1/requests_controller_spec.rb index 8ec9f80..5ff7e92 100644 --- a/spec/acceptance/api/v1/requests_controller_spec.rb +++ b/spec/acceptance/api/v1/requests_controller_spec.rb @@ -238,7 +238,6 @@ end put '/api/v1/requests/:id' do - let!(:request3) { requests(:request3) } let(:id) { request3.id } @@ -262,7 +261,7 @@ type: :integer let(:plant_stage_id) { Plant.last.plant_stages.last.id } - let(:name) { 'My request'} + let(:name) { 'My request' } let(:plant_name) { Plant.last.name } let(:plant_stage_name) { Plant.last.plant_stages.last.name } let(:due_date) { Date.current + 6.months } diff --git a/spec/requests/api/v1/requests_spec.rb b/spec/requests/api/v1/requests_spec.rb index d4aeabc..b79dfaa 100644 --- a/spec/requests/api/v1/requests_spec.rb +++ b/spec/requests/api/v1/requests_spec.rb @@ -451,13 +451,13 @@ end end end + context 'when 422' do let!(:request3) { requests(:request3) } let!(:id) { request3.id } it_behaves_like 'with authenticated grower' do it 'fails to update a request' do - allow_any_instance_of(Request).to receive(:update).and_return(false) put( @@ -478,6 +478,7 @@ end end end + context 'when 404' do it_behaves_like 'with authenticated grower' do it 'can\'t update a request that doesn\'t exist' do @@ -499,6 +500,7 @@ end end end + context 'when 401' do it_behaves_like 'without authentication' do it 'can\'t update a request' do