Write tests - Write tests for what was done to this point that will be kept #11

Merged
okorpheus merged 61 commits from write-tests into master 2024-07-05 21:21:32 +00:00
1 changed files with 28 additions and 0 deletions
Showing only changes of commit a051808c2d - Show all commits

View File

@ -0,0 +1,28 @@
<?php
use App\Models\Audition;
use App\Models\Ensemble;
use App\Models\SeatingLimit;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
beforeEach(function () {
$this->ensemble = Ensemble::factory()->create();
$this->audition = Audition::factory()->create();
$this->seatingLimit = SeatingLimit::create([
'audition_id' => $this->audition->id,
'ensemble_id' => $this->ensemble->id,
'maximum_accepted' => 10,
]);
});
it('has an audition', function () {
expect($this->seatingLimit->audition->name)->toBe($this->audition->name)
->and($this->seatingLimit)->toBeInstanceOf(SeatingLimit::class);
});
it('has an ensemble', function () {
expect($this->seatingLimit->ensemble)->toBeInstanceOf(Ensemble::class)
->and($this->seatingLimit->ensemble->name)->toBe($this->ensemble->name);
});