18 lines
446 B
PHP
18 lines
446 B
PHP
<?php
|
|
|
|
use App\Models\Audition;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
test('only returns open auditions for open scope', function () {
|
|
// Arrange
|
|
$openAudition = Audition::factory()->create();
|
|
$closedAudition = Audition::factory()->closed()->create();
|
|
|
|
// Act & Assert
|
|
expect(Audition::open()->get())
|
|
->toHaveCount(1)
|
|
->first()->id->toEqual($openAudition->id);
|
|
});
|