tasks: ensure creating an empty champ doesn’t display a notification

This commit is contained in:
Pierre de La Morinerie 2019-06-24 15:49:02 +02:00
parent 5c2bd46000
commit 50cf6059e6
2 changed files with 6 additions and 4 deletions

View file

@ -85,8 +85,10 @@ class PieceJustificativeToChampPieceJointeMigrationService
)
else
champ.update_columns(
updated_at: dossier.updated_at,
created_at: dossier.created_at
created_at: dossier.created_at,
# Set an updated_at date that won't cause notifications to appear
# on gestionnaires' dashboard.
updated_at: dossier.created_at
)
end

View file

@ -113,9 +113,9 @@ describe PieceJustificativeToChampPieceJointeMigrationService do
dossier.reload
end
it 'the champ has the same timestamps as the dossier' do
it 'the champ doesnt trigger a notification' do
expect(dossier.champs.last.created_at).to eq(initial_dossier_timestamps[:created_at])
expect(dossier.champs.last.updated_at).to eq(initial_dossier_timestamps[:updated_at])
expect(dossier.champs.last.updated_at).to eq(initial_dossier_timestamps[:created_at])
end
it 'does not change the dossier timestamps' do