Skip to content

Commit fbffe5f

Browse files
tchakclaude
andcommitted
test: migrate dossier spec examples to seeded records
Replace factory procedure/dossier setup with oaken seeds in sixteen describe blocks (~55 examples), scope the remaining global DossierNotification.count assertions, and backdate seeded dossier traitements by one day so specs freezing time to earlier today still see them in the past. Full spec runs ~15% faster than the factory baseline. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5fef6bc commit fbffe5f

2 files changed

Lines changed: 73 additions & 81 deletions

File tree

db/seeds/dossiers.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
if state != Dossier.states.fetch(:brouillon)
1919
dossier.state = state
20-
processed_at = DossierWithReferenceDate.assign(dossier)
20+
# Deposited dossiers are backdated so that specs freezing time to earlier
21+
# today still see the seeded traitements in the past.
22+
processed_at = DossierWithReferenceDate.assign(dossier, reference_date: 1.day.ago)
2123

2224
case state
2325
when Dossier.states.fetch(:en_construction)

0 commit comments

Comments
 (0)