From 6739bfc6651ecd9f7ec377b1232bb6d12ef478e4 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 21 Apr 2023 09:35:16 +0200 Subject: [PATCH] =?UTF-8?q?bug(instructeurs.annotations):=20ETQ=20instruct?= =?UTF-8?q?eurs,=20lorsque=20je=20saisie=20une=20autre=20valeur=20dans=20u?= =?UTF-8?q?n=20champ=20de=20type=20choix=20simple,=20celle=20ci=20n'est=20?= =?UTF-8?q?pas=20sauvegard=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../instructeurs/dossiers_controller_spec.rb | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/spec/controllers/instructeurs/dossiers_controller_spec.rb b/spec/controllers/instructeurs/dossiers_controller_spec.rb index 06f94d716..4b499faf4 100644 --- a/spec/controllers/instructeurs/dossiers_controller_spec.rb +++ b/spec/controllers/instructeurs/dossiers_controller_spec.rb @@ -762,28 +762,19 @@ describe Instructeurs::DossiersController, type: :controller do { type: :multiple_drop_down_list }, { type: :linked_drop_down_list }, { type: :datetime }, - { type: :repetition, children: [{}] } + { type: :repetition, children: [{}] }, + { type: :drop_down_list, options: [:a, :b, :other] } ], instructeurs: instructeurs) end let(:dossier) { create(:dossier, :en_construction, :with_populated_annotations, procedure: procedure) } let(:another_instructeur) { create(:instructeur) } let(:now) { Time.zone.parse('01/01/2100') } - let(:champ_multiple_drop_down_list) do - dossier.champs_private.first - end - - let(:champ_linked_drop_down_list) do - dossier.champs_private.second - end - - let(:champ_datetime) do - dossier.champs_private.third - end - - let(:champ_repetition) do - dossier.champs_private.fourth - end + let(:champ_multiple_drop_down_list) { dossier.champs_private.first } + let(:champ_linked_drop_down_list) { dossier.champs_private.second } + let(:champ_datetime) { dossier.champs_private.third } + let(:champ_repetition) { dossier.champs_private.fourth } + let(:champ_drop_down_list) { dossier.champs_private.fifth } before do expect(controller.current_instructeur).to receive(:mark_tab_as_seen).with(dossier, :annotations_privees) @@ -795,6 +786,7 @@ describe Instructeurs::DossiersController, type: :controller do champ_linked_drop_down_list.reload champ_datetime.reload champ_repetition.reload + champ_drop_down_list.reload end after do @@ -824,6 +816,11 @@ describe Instructeurs::DossiersController, type: :controller do '3': { id: champ_repetition.champs.first.id, value: 'text' + }, + '4': { + id: champ_drop_down_list.id, + value: '__other__', + value_other: 'other value' } } } @@ -836,6 +833,7 @@ describe Instructeurs::DossiersController, type: :controller do expect(champ_linked_drop_down_list.secondary_value).to eq('secondary') expect(champ_datetime.value).to eq('2019-12-21T13:17:00+01:00') expect(champ_repetition.champs.first.value).to eq('text') + expect(champ_drop_down_list.value).to eq('other value') expect(dossier.reload.last_champ_private_updated_at).to eq(now) expect(response).to have_http_status(200) }