Create JudgeAdvancementVoteTest.php
This commit is contained in:
parent
0c1a157a94
commit
0cf4727aac
|
|
@ -0,0 +1,28 @@
|
|||
<?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);
|
||||
});
|
||||
Loading…
Reference in New Issue