Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETQ admin: correction du cache de la liste des PJ d'une démarche en brouillon #10008

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/shared/_procedure_description.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
14 changes: 14 additions & 0 deletions spec/views/shared/_procedure_description.html.haml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,19 @@
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