toBe('secret'); }); it('can create an AuditLog entry', function () { actAsAdmin(); auditionLog('This is the message', ['users' => [1, 2, 3], 'entries' => [4, 5, 6]]); $logEntry = AuditLogEntry::orderBy('id', 'desc')->first(); expect($logEntry->user)->toBe(auth()->user()->email) ->and($logEntry->message)->toBe('This is the message') ->and($logEntry->affected)->toEqual(['users' => [1, 2, 3], 'entries' => [4, 5, 6]]); }); it('can enter a score', function () { $room = Room::factory()->create(); $scoringGuide = ScoringGuide::factory()->create(); $audition = Audition::factory()->create([ 'room_id' => $room->id, 'order_in_room' => 1, 'maximum_grade' => 15, 'minimum_grade' => 1, 'scoring_guide_id' => $scoringGuide->id, ]); $student = Student::factory()->create(); $entry = Entry::create(['audition_id' => $audition->id, 'student_id' => $student->id]); $judge = User::factory()->create(); $room->judges()->attach($judge); enterScore($judge, $entry, [ 1 => 10, 2 => 10, 3 => 4, 4 => 10, 5 => 10, ]); expect(ScoreSheet::count())->toBe(1); });