42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
use App\Models\Audition;
|
|
use App\Models\PrelimDefinition;
|
|
use App\Models\Room;
|
|
use App\Models\ScoringGuide;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
beforeEach(function () {
|
|
$this->audition = Audition::factory()->create();
|
|
$this->prelim = PrelimDefinition::create([
|
|
'audition_id' => $this->audition->id,
|
|
'passing_score' => 80,
|
|
]);
|
|
});
|
|
|
|
it('can provide its audition', function () {
|
|
expect($this->prelim->audition->name)->toEqual($this->audition->name);
|
|
});
|
|
|
|
it('can return its room if one is set', function () {
|
|
$room = Room::factory()->create();
|
|
$this->prelim->room()->associate($room);
|
|
expect($this->prelim->room->name)->toEqual($room->name);
|
|
});
|
|
|
|
it('returns null if no room is set', function () {
|
|
expect($this->prelim->room)->toBeNull();
|
|
});
|
|
|
|
it('returns its scoring guide if one is set', function () {
|
|
$guide = ScoringGuide::factory()->create();
|
|
$this->prelim->scoringGuide()->associate($guide);
|
|
expect($this->prelim->scoringGuide->name)->toEqual($guide->name);
|
|
});
|
|
|
|
it('returns null if no scoring guide is set', function () {
|
|
expect($this->prelim->scoringGuide)->toBeNull();
|
|
});
|