Rewrite tabulation #14

Merged
okorpheus merged 43 commits from rewrite-tabulation into master 2024-07-14 05:36:29 +00:00
1 changed files with 24 additions and 0 deletions
Showing only changes of commit a14bfbf168 - Show all commits

View File

@ -0,0 +1,24 @@
<?php
use App\Models\Audition;
use App\Models\Entry;
use App\Services\EntryService;
use Carbon\Carbon;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\App;
uses(RefreshDatabase::class);
beforeEach(function() {
$this->entryService = App::make(EntryService::class);
});
it('checks if an entry is late', function() {
$openAudition = Audition::factory()->create(['entry_deadline' => Carbon::tomorrow()]);
$closedAudition = Audition::factory()->create(['entry_deadline' => Carbon::yesterday()]);
$onTime = Entry::factory()->create(['audition_id' => $openAudition->id]);
$late = Entry::factory()->create(['audition_id' => $closedAudition]);
expect($this->entryService->isEntryLate($onTime))->toBeFalse();
expect($this->entryService->isEntryLate($late))->toBeTrue();
});