fix(test): use deterministic uploaded_at in ServiceControllerTest
Faker's dateTimeBetween ignores Carbon::setTestNow, producing dates after the frozen test time. This caused the info_slides_count assertion to fail non-deterministically when the system date diverged from the test-frozen date.
This commit is contained in:
parent
2a23f0d210
commit
894e26f37d
|
|
@ -99,30 +99,35 @@ public function test_services_index_zeigt_nur_heutige_und_kuenftige_services_mit
|
|||
'service_id' => $todayService->id,
|
||||
'type' => 'sermon',
|
||||
'expire_date' => null,
|
||||
'uploaded_at' => Carbon::today()->subDays(2),
|
||||
]);
|
||||
|
||||
Slide::factory()->create([
|
||||
'service_id' => null,
|
||||
'type' => 'information',
|
||||
'expire_date' => Carbon::today()->addDay(),
|
||||
'uploaded_at' => Carbon::today()->subDays(3),
|
||||
]);
|
||||
|
||||
Slide::factory()->create([
|
||||
'service_id' => null,
|
||||
'type' => 'information',
|
||||
'expire_date' => Carbon::today()->addDays(5),
|
||||
'uploaded_at' => Carbon::today()->subDays(2),
|
||||
]);
|
||||
|
||||
Slide::factory()->create([
|
||||
'service_id' => $todayService->id,
|
||||
'type' => 'information',
|
||||
'expire_date' => Carbon::today()->addDays(10),
|
||||
'uploaded_at' => Carbon::today()->subDay(),
|
||||
]);
|
||||
|
||||
Slide::factory()->create([
|
||||
'service_id' => null,
|
||||
'type' => 'information',
|
||||
'expire_date' => Carbon::today()->subDay(),
|
||||
'uploaded_at' => Carbon::today()->subDays(5),
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user)->get(route('services.index'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue