Merge pull request #3988 from betagouv/fix-pj-migration-notifications

PJ Migration : ensure creating an empty champ doesn’t display a notification
This commit is contained in:
Nicolas Bouilleaud 2019-06-24 16:55:38 +02:00 committed by GitHub
commit 3d2e6581f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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