Merge pull request #10146 from colinux/fix-champ-built-updated-at
Tech: pas de comparaison avec champ#updated_at lorsque le champ n'est pas persisté
This commit is contained in:
commit
ebe762ee5d
2 changed files with 14 additions and 0 deletions
|
@ -10,6 +10,7 @@ class Dossiers::ChampsRowsShowComponent < ApplicationComponent
|
||||||
|
|
||||||
def updated_at_after_deposer(champ)
|
def updated_at_after_deposer(champ)
|
||||||
return if champ.dossier.depose_at.blank?
|
return if champ.dossier.depose_at.blank?
|
||||||
|
return if champ.new_record?
|
||||||
|
|
||||||
if champ.updated_at > champ.dossier.depose_at
|
if champ.updated_at > champ.dossier.depose_at
|
||||||
champ.updated_at
|
champ.updated_at
|
||||||
|
|
|
@ -51,4 +51,17 @@ describe 'shared/dossiers/demande', type: :view do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when a champ is freshly build' do
|
||||||
|
let(:procedure) { create(:procedure, :published, :with_type_de_champ) }
|
||||||
|
before do
|
||||||
|
dossier.champs_public.first.destroy
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'renders without error' do
|
||||||
|
procedure.active_revision.types_de_champ.each do |tdc|
|
||||||
|
expect(subject).to include(tdc.libelle)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue