Skip to content

Commit

Permalink
fix department_code for rna et rnf spec but not sure of AddressProxy:…
Browse files Browse the repository at this point in the history
…:Address_parts. Should I do something on AddressProxy
  • Loading branch information
LeSim committed Jan 14, 2025
1 parent ef2ba2b commit 795c0f6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions spec/factories/champ.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@

factory :champ_do_not_use_rna, class: 'Champs::RNAChamp' do
value { 'W173847273' }
value_json { AddressProxy::ADDRESS_PARTS.index_by(&:itself).merge(title: "LA PRÉVENTION ROUTIERE") }
value_json { AddressProxy::ADDRESS_PARTS.index_by(&:itself).merge(title: "LA PRÉVENTION ROUTIERE", department_code: 'department_code') }
end

factory :champ_do_not_use_engagement_juridique, class: 'Champs::EngagementJuridiqueChamp' do
Expand All @@ -176,7 +176,7 @@
factory :champ_do_not_use_rnf, class: 'Champs::RNFChamp' do
value { '075-FDD-00003-01' }
external_id { '075-FDD-00003-01' }
value_json { AddressProxy::ADDRESS_PARTS.index_by(&:itself).merge(title: "Fondation SFR") }
value_json { AddressProxy::ADDRESS_PARTS.index_by(&:itself).merge(title: "Fondation SFR", department_code: 'department_code') }
end

factory :champ_do_not_use_expression_reguliere, class: 'Champs::ExpressionReguliereChamp' do
Expand Down
4 changes: 2 additions & 2 deletions spec/models/columns/champ_column_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
expect_type_de_champ_values('mesri', eq([nil]))
expect_type_de_champ_values('cojo', eq([nil]))
expect_type_de_champ_values('expression_reguliere', eq([nil]))
expect_type_de_champ_values('rna', eq(["W173847273", "postal_code", "city_name", "departement_code", "region_name", "LA PRÉVENTION ROUTIERE"]))
expect_type_de_champ_values('rnf', eq(["075-FDD-00003-01", "postal_code", "city_name", "departement_code", "region_name", "Fondation SFR"]))
expect_type_de_champ_values('rna', eq(["W173847273", "postal_code", "city_name", "department_code", "region_name", "LA PRÉVENTION ROUTIERE"]))
expect_type_de_champ_values('rnf', eq(["075-FDD-00003-01", "postal_code", "city_name", "department_code", "region_name", "Fondation SFR"]))
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/services/dossier_filter_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ def to_filter((label, filter)) = FilteredColumn.new(column: procedure.find_colum
let(:filter) { ["rna – Département", value] }

before do
kept_dossier.project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "departement_code" => value })
create(:dossier, procedure:).project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "departement_code" => "unknown" })
kept_dossier.project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "department_code" => value })
create(:dossier, procedure:).project_champs_public.find { _1.stable_id == 1 }.update(value_json: { "department_code" => "unknown" })
end

it { is_expected.to contain_exactly(kept_dossier.id) }
Expand Down
2 changes: 1 addition & 1 deletion spec/services/dossier_projection_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
let(:label) { "SIRET – Département" }

before do
dossier.project_champs_public.first.update(value_json: { 'departement_code': '38' })
dossier.project_champs_public.first.update(value_json: { 'department_code': '38' })
end

it { is_expected.to eq('38') }
Expand Down
4 changes: 2 additions & 2 deletions spec/system/instructeurs/procedure_filters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@
"street_name" => "fake",
"street_number" => "fake",
"street_address" => "fake",
"departement_code" => "37",
"departement_name" => "Indre-et-Loire"
"department_code" => "37",
"department_name" => "Indre-et-Loire"
}
)
rna_champ.reload
Expand Down

0 comments on commit 795c0f6

Please sign in to comment.