From db22918ff815fd3e49d4f8194c841ebdfa56a337 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Mon, 30 Jun 2025 21:53:54 -0500 Subject: [PATCH] Finis CreateEntries tests --- .../app/Actions/Entries/CreateEntriesTest.php | 18 ++++++++++++++++++ .../Actions/Entries/DoublerDecisionTest.php | 11 +++++++++++ 2 files changed, 29 insertions(+) create mode 100644 tests/Feature/app/Actions/Entries/DoublerDecisionTest.php diff --git a/tests/Feature/app/Actions/Entries/CreateEntriesTest.php b/tests/Feature/app/Actions/Entries/CreateEntriesTest.php index 1ba766c..1eb0ea5 100644 --- a/tests/Feature/app/Actions/Entries/CreateEntriesTest.php +++ b/tests/Feature/app/Actions/Entries/CreateEntriesTest.php @@ -24,6 +24,24 @@ it('can create an entry', function () { expect($thisEntry)->toBeInstanceOf(Entry::class); }); +it('is invokable', function () { + $student = Student::factory()->create(['grade' => 9]); + $audition = Audition::factory()->create(['minimum_grade' => 9, 'maximum_grade' => 12]); + ($this->scribe)($student, $audition); + $thisEntry = Entry::where('student_id', $student->id)->first(); + + expect($thisEntry)->toBeInstanceOf(Entry::class); +}); + +it('accepts integer IDs as well as models for arguments', function () { + $student = Student::factory()->create(['grade' => 9]); + $audition = Audition::factory()->create(['minimum_grade' => 9, 'maximum_grade' => 12]); + $this->scribe->createEntry($student->id, $audition->id); + $thisEntry = Entry::where('student_id', $student->id)->first(); + + expect($thisEntry)->toBeInstanceOf(Entry::class); +}); + it('defaults to entering seating and advancement', function () { $student = Student::factory()->create(['grade' => 9]); $audition = Audition::factory()->create(['minimum_grade' => 9, 'maximum_grade' => 12]); diff --git a/tests/Feature/app/Actions/Entries/DoublerDecisionTest.php b/tests/Feature/app/Actions/Entries/DoublerDecisionTest.php new file mode 100644 index 0000000..26b7e1b --- /dev/null +++ b/tests/Feature/app/Actions/Entries/DoublerDecisionTest.php @@ -0,0 +1,11 @@ +get('/'); + + $response->assertStatus(200); +});