25 lines
809 B
PHP
25 lines
809 B
PHP
<?php
|
|
|
|
use App\Models\Audition;
|
|
use App\Models\ScoringGuide;
|
|
use App\Models\SubscoreDefinition;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
beforeEach(function () {
|
|
$this->sg = ScoringGuide::factory()->create();
|
|
});
|
|
|
|
it('can return its auditions', function () {
|
|
Audition::factory()->count(3)->create(['scoring_guide_id' => $this->sg->id]);
|
|
Audition::factory()->count(3)->create(['scoring_guide_id' => null]);
|
|
expect($this->sg->auditions()->count())->toEqual(3)
|
|
->and($this->sg->auditions()->first())->toBeInstanceOf(Audition::class);
|
|
});
|
|
|
|
it('can return its subscore definitions', function () {
|
|
expect($this->sg->subscores()->count())->toEqual(5)
|
|
->and($this->sg->subscores()->first())->toBeInstanceOf(SubscoreDefinition::class);
|
|
});
|