From 2ae2d99e93362d4f5cb89a74e4914776222cd6b6 Mon Sep 17 00:00:00 2001 From: sebastiencarceles Date: Tue, 28 Feb 2023 08:36:43 +0100 Subject: [PATCH] fix communes: all possible values --- app/models/types_de_champ/prefill_commune_type_de_champ.rb | 2 +- app/views/prefill_type_de_champs/show.html.haml | 2 +- .../types_de_champ/prefill_commune_type_de_champ_spec.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/types_de_champ/prefill_commune_type_de_champ.rb b/app/models/types_de_champ/prefill_commune_type_de_champ.rb index 49dbb1a11..03f5acdee 100644 --- a/app/models/types_de_champ/prefill_commune_type_de_champ.rb +++ b/app/models/types_de_champ/prefill_commune_type_de_champ.rb @@ -1,5 +1,5 @@ class TypesDeChamp::PrefillCommuneTypeDeChamp < TypesDeChamp::PrefillTypeDeChamp - def possible_values + def all_possible_values departements.map do |departement| "#{departement[:code]} (#{departement[:name]}) : https://geo.api.gouv.fr/communes?codeDepartement=#{departement[:code]}" end diff --git a/app/views/prefill_type_de_champs/show.html.haml b/app/views/prefill_type_de_champs/show.html.haml index 342cdc7b3..08eb4c6ae 100644 --- a/app/views/prefill_type_de_champs/show.html.haml +++ b/app/views/prefill_type_de_champs/show.html.haml @@ -27,7 +27,7 @@ %td .fr-grid-row.fr-grid-row--gutters.fr-py-5w - @type_de_champ.all_possible_values.each do |possible_value| - .fr-col-lg-3.fr-col-md-4.fr-col-sm-6.fr-col-12 + .fr-col-md-4.fr-col-sm-6.fr-col-12 = possible_value %tr %th diff --git a/spec/models/types_de_champ/prefill_commune_type_de_champ_spec.rb b/spec/models/types_de_champ/prefill_commune_type_de_champ_spec.rb index aeff12e01..3e058d743 100644 --- a/spec/models/types_de_champ/prefill_commune_type_de_champ_spec.rb +++ b/spec/models/types_de_champ/prefill_commune_type_de_champ_spec.rb @@ -26,13 +26,13 @@ RSpec.describe TypesDeChamp::PrefillCommuneTypeDeChamp do it { is_expected.to be_kind_of(TypesDeChamp::PrefillTypeDeChamp) } end - describe '#possible_values' do + describe '#all_possible_values' do let(:expected_values) do departements.map { |departement| "#{departement[:code]} (#{departement[:name]}) : https://geo.api.gouv.fr/communes?codeDepartement=#{departement[:code]}" } end - subject(:possible_values) { described_class.new(type_de_champ, procedure.active_revision).possible_values } + subject(:all_possible_values) { described_class.new(type_de_champ, procedure.active_revision).all_possible_values } - it { expect(possible_values).to match(expected_values) } + it { expect(all_possible_values).to match(expected_values) } end describe '#example_value' do