create(); $notJudgeUser = User::factory()->create(); $finalsRoom = Room::factory()->create(); $audition = Audition::factory()->create(['room_id' => $finalsRoom->id]); $room = Room::factory()->create(); $finalsRoom = Room::factory()->create(); $prelimDefinition = PrelimDefinition::create([ 'audition_id' => $audition->id, 'room_id' => $room->id, 'scoring_guide_id' => 0, 'passing_score' => 75, ]); $room->addJudge($judgeUser); $finalsRoom->addJudge($notJudgeUser); $this->actingAs($notJudgeUser); $this->get(route('judging.prelimEntryList', $prelimDefinition)) ->assertRedirect(route('dashboard')) ->assertSessionHas('error', 'You are not assigned to judge that prelim audition.'); $this->actingAs($judgeUser); $this->get(route('judging.prelimEntryList', $prelimDefinition)) ->assertOk(); }); it('shows all auditions entered in the given audition', function () { $judgeUser = User::factory()->create(); $finalsRoom = Room::factory()->create(); $audition = Audition::factory()->create(['room_id' => $finalsRoom->id, 'name' => 'Euphonium']); $room = Room::factory()->create(); $prelimDefinition = PrelimDefinition::create([ 'audition_id' => $audition->id, 'room_id' => $room->id, 'scoring_guide_id' => 0, 'passing_score' => 75, ]); $room->addJudge($judgeUser); $entries = Entry::factory()->count(5)->create(['audition_id' => $audition->id]); app(RunDraw::class)($audition); $this->actingAs($judgeUser); $response = $this->get(route('judging.prelimEntryList', $prelimDefinition)); $response->assertOk(); foreach ($entries as $entry) { $entry->refresh(); $identifierString = $entry->audition->name.' '.$entry->draw_number; $response->assertSee($identifierString); } }); it('shows scores for previously judged entries', function () { }); it('has links to enter scores for each entry', function () { }); it('does not allow modifications to an entry that has finals scores', function () { }); });