29 lines
830 B
PHP
29 lines
830 B
PHP
<?php
|
|
|
|
use App\Models\Entry;
|
|
use App\Models\JudgeAdvancementVote;
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
beforeEach(function () {
|
|
$this->judge = User::factory()->create();
|
|
$this->entry = Entry::factory()->create();
|
|
$this->vote = JudgeAdvancementVote::create([
|
|
'user_id' => $this->judge->id,
|
|
'entry_id' => $this->entry->id,
|
|
'vote' => 'pass',
|
|
]);
|
|
});
|
|
|
|
test('has a judge', function () {
|
|
expect($this->vote->judge)->toBeInstanceOf(User::class)
|
|
->and($this->vote->judge->first_name)->toBe($this->judge->first_name);
|
|
});
|
|
|
|
test('has an entry', function () {
|
|
expect($this->vote->entry)->toBeInstanceOf(Entry::class)
|
|
->and($this->vote->entry->student->first_name)->toBe($this->entry->student->first_name);
|
|
});
|