fix(instructeurs): don't fail when removing all displayed fields
This commit is contained in:
parent
11208aa6b9
commit
6a6e643771
2 changed files with 8 additions and 1 deletions
|
@ -134,7 +134,8 @@ module Instructeurs
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_displayed_fields
|
def update_displayed_fields
|
||||||
values = params['values'].presence || []
|
values = (params['values'].presence || []).reject(&:empty?)
|
||||||
|
|
||||||
procedure_presentation.update_displayed_fields(values)
|
procedure_presentation.update_displayed_fields(values)
|
||||||
|
|
||||||
redirect_back(fallback_location: instructeur_procedure_url(procedure))
|
redirect_back(fallback_location: instructeur_procedure_url(procedure))
|
||||||
|
|
|
@ -60,6 +60,12 @@ describe "procedure filters" do
|
||||||
expect(page).not_to have_link(type_de_champ.libelle)
|
expect(page).not_to have_link(type_de_champ.libelle)
|
||||||
expect(page).not_to have_link(champ.value)
|
expect(page).not_to have_link(champ.value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Test removal of all customizable fields
|
||||||
|
remove_column("Demandeur")
|
||||||
|
within ".dossiers-table" do
|
||||||
|
expect(page).not_to have_link("Demandeur")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "should be able to add and remove filter", js: true do
|
scenario "should be able to add and remove filter", js: true do
|
||||||
|
|
Loading…
Reference in a new issue