Create SeatingLimitTest.php
This commit is contained in:
parent
7adb008d0a
commit
a051808c2d
|
|
@ -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);
|
||||
});
|
||||
Loading…
Reference in New Issue