Merge pull request #10008 from colinux/fix-draft-procedure-description-cache
ETQ admin: correction du cache de la liste des PJ d'une démarche en brouillon
This commit is contained in:
commit
fc482c1607
2 changed files with 15 additions and 1 deletions
|
@ -24,7 +24,7 @@
|
|||
|
||||
- unless @no_description
|
||||
.fr-accordions-group.fr-mb-3w
|
||||
- cache [I18n.locale, procedure, "description"] do
|
||||
- cache_unless(procedure.brouillon?, [I18n.locale, procedure, "description"]) do
|
||||
%section.fr-accordion
|
||||
%h2.fr-accordion__title
|
||||
%button.fr-accordion__btn{ "aria-controls" => "accordion-114", "aria-expanded" => "true" }
|
||||
|
|
|
@ -124,5 +124,19 @@ describe 'shared/_procedure_description', type: :view do
|
|||
render partial: 'shared/procedure_description', locals: { procedure: }
|
||||
expect(rendered).to have_text('new pj')
|
||||
end
|
||||
|
||||
context 'draft procedure' do
|
||||
let(:procedure) { create(:procedure, :draft) }
|
||||
|
||||
it 'respect revision changes on brouillon' do
|
||||
render partial: 'shared/procedure_description', locals: { procedure: }
|
||||
expect(rendered).not_to have_text('new pj')
|
||||
|
||||
procedure.draft_revision.add_type_de_champ(type_champ: :piece_justificative, libelle: 'new pj')
|
||||
|
||||
render partial: 'shared/procedure_description', locals: { procedure: }
|
||||
expect(rendered).to have_text('new pj')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue