From b71d60dff94c6a1b0f95cfe6a613d8e8966f118b Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 4 Dec 2024 12:07:12 +0100 Subject: [PATCH] test(siret): fix after champ factory have been changed to real values --- .../maintenance/populate_siret_value_json_task_spec.rb | 4 ++++ .../dossiers/_normalized_address.html.haml_spec.rb | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/spec/tasks/maintenance/populate_siret_value_json_task_spec.rb b/spec/tasks/maintenance/populate_siret_value_json_task_spec.rb index f5e1a29a6..2bb454fe4 100644 --- a/spec/tasks/maintenance/populate_siret_value_json_task_spec.rb +++ b/spec/tasks/maintenance/populate_siret_value_json_task_spec.rb @@ -10,6 +10,10 @@ module Maintenance let(:element) { dossier.champs.first } subject(:process) { described_class.process(element) } + before do + element.update!(value_json: nil) + end + it 'updates value_json' do expect { subject }.to change { element.reload.value_json } .from(anything) diff --git a/spec/views/shared/dossiers/_normalized_address.html.haml_spec.rb b/spec/views/shared/dossiers/_normalized_address.html.haml_spec.rb index 9e1a722e3..37f5cbfa9 100644 --- a/spec/views/shared/dossiers/_normalized_address.html.haml_spec.rb +++ b/spec/views/shared/dossiers/_normalized_address.html.haml_spec.rb @@ -9,9 +9,12 @@ describe 'shared/dossiers/normalized_address', type: :view do let(:address) { AddressProxy.new(dossier.champs.first) } it 'render address' do - AddressProxy::ADDRESS_PARTS.each do |address_part| - expect(subject).to have_text(address_part) - end + expect(subject).to have_text("6 RUE RAOUL NORDLING") + expect(subject).to have_text("Bois-Colombes") + expect(subject).to have_text("92270") + expect(subject).to have_text("92009") + expect(subject).to have_text("Hauts-de-Seine – 92") + expect(subject).to have_text("Île-de-France – 11") end end