29 lines
871 B
PHP
29 lines
871 B
PHP
<?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);
|
|
});
|