remove_all as there is no some_usager_columns

This commit is contained in:
simon lehericey 2024-10-30 16:07:16 +01:00
parent 2181a917a2
commit 92a863d48c
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 8 additions and 8 deletions

View file

@ -30,7 +30,7 @@ module ColumnsConcern
end end
end end
def all_usager_columns_for_export def usager_columns_for_export
columns = [dossier_id_column, user_email_for_display_column, user_france_connected_column] columns = [dossier_id_column, user_email_for_display_column, user_france_connected_column]
columns.concat(individual_columns) if for_individual columns.concat(individual_columns) if for_individual
columns.concat(moral_columns) if !for_individual columns.concat(moral_columns) if !for_individual
@ -39,7 +39,7 @@ module ColumnsConcern
columns.flatten.compact columns.flatten.compact
end end
def all_dossier_columns_for_export def dossier_columns_for_export
columns = [dossier_state_column] columns = [dossier_state_column]
columns.concat([dossier_archived_column]) columns.concat([dossier_archived_column])
columns.concat(dossier_dates_columns) columns.concat(dossier_dates_columns)

View file

@ -146,7 +146,7 @@ describe ColumnsConcern do
] ]
end end
describe '#all_usager_columns_for_export' do describe '#usager_columns_for_export' do
context 'for individual procedure' do context 'for individual procedure' do
let(:for_individual) { true } let(:for_individual) { true }
@ -162,7 +162,7 @@ describe ColumnsConcern do
procedure.find_column(label: "Nom du mandataire"), procedure.find_column(label: "Nom du mandataire"),
procedure.find_column(label: "Prénom du mandataire") procedure.find_column(label: "Prénom du mandataire")
] ]
actuals = procedure.all_usager_columns_for_export.map(&:h_id) actuals = procedure.usager_columns_for_export.map(&:h_id)
expected.each do |expected_col| expected.each do |expected_col|
expect(actuals).to include(expected_col.h_id) expect(actuals).to include(expected_col.h_id)
end end
@ -199,7 +199,7 @@ describe ColumnsConcern do
procedure.find_column(label: "Entreprise SIRET siège social"), procedure.find_column(label: "Entreprise SIRET siège social"),
procedure.find_column(label: "Entreprise code effectif entreprise") procedure.find_column(label: "Entreprise code effectif entreprise")
] ]
actuals = procedure.all_usager_columns_for_export actuals = procedure.usager_columns_for_export
expected.each do |expected_col| expected.each do |expected_col|
expect(actuals.map(&:h_id)).to include(expected_col.h_id) expect(actuals.map(&:h_id)).to include(expected_col.h_id)
end end
@ -217,7 +217,7 @@ describe ColumnsConcern do
procedure.find_column(label: "Référentiel De Programmation"), procedure.find_column(label: "Référentiel De Programmation"),
procedure.find_column(label: "Centre De Coût") procedure.find_column(label: "Centre De Coût")
] ]
actuals = procedure.all_usager_columns_for_export.map(&:h_id) actuals = procedure.usager_columns_for_export.map(&:h_id)
expected.each do |expected_col| expected.each do |expected_col|
expect(actuals).to include(expected_col.h_id) expect(actuals).to include(expected_col.h_id)
end end
@ -225,7 +225,7 @@ describe ColumnsConcern do
end end
end end
describe '#all_dossier_columns_for_export' do describe '#dossier_columns_for_export' do
let(:procedure) { create(:procedure_with_dossiers, :routee, :published, types_de_champ_public:, for_individual:) } let(:procedure) { create(:procedure_with_dossiers, :routee, :published, types_de_champ_public:, for_individual:) }
it "returns all dossier columns" do it "returns all dossier columns" do
@ -241,7 +241,7 @@ describe ColumnsConcern do
procedure.find_column(label: "Instructeurs"), procedure.find_column(label: "Instructeurs"),
procedure.find_column(label: "Groupe instructeur") procedure.find_column(label: "Groupe instructeur")
] ]
actuals = procedure.all_dossier_columns_for_export.map(&:h_id) actuals = procedure.dossier_columns_for_export.map(&:h_id)
expected.each do |expected_col| expected.each do |expected_col|
expect(actuals).to include(expected_col.h_id) expect(actuals).to include(expected_col.h_id)
end end