create(['suite' => 'softbench', 'model_id' => 'snap/model', 'visibility' => 'public']); SoftbenchResult::factory()->create(['benchmark_run_id' => $run->id, 'task' => 'snap-task']); BenchmarkRun::factory()->private()->create(['suite' => 'softbench']); Artisan::call('festbench:snapshot'); $rows = DB::table('home_snapshot')->get(); expect($rows)->toHaveCount(1) ->and($rows[0]->task)->toBe('snap-task') ->and($rows[0]->model_id)->toBe('snap/model') ->and($rows[0]->run_id)->toBe($run->run_id); }); test('guest default home view reads the snapshot, no union needed', function () { $run = BenchmarkRun::factory()->create(['suite' => 'softbench', 'visibility' => 'public']); SoftbenchResult::factory()->create(['benchmark_run_id' => $run->id, 'task' => 'snapshotted-task']); Artisan::call('festbench:snapshot'); // The snapshot is the only path that knows this task name; seeing it // proves the default view served from home_snapshot. $this->get(route('home'))->assertOk()->assertSee('snapshotted-task'); }); test('guest pages get public cache headers, authenticated pages do not', function () { $guest = $this->get(route('home')); expect($guest->headers->get('Cache-Control'))->toContain('public') ->and($guest->headers->get('Cache-Control'))->toContain('s-maxage'); $this->actingAs(User::factory()->create()); $auth = $this->get(route('home')); expect($auth->headers->get('Cache-Control'))->toContain('private') ->and($auth->headers->get('Cache-Control'))->not->toContain('public'); });