Create tests for app/Models/judgeAdvancementVote
This commit is contained in:
parent
e01ff95432
commit
711f2d2859
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Entry;
|
||||
use App\Models\JudgeAdvancementVote;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
beforeEach(function () {
|
||||
$this->entry = Entry::factory()->create();
|
||||
$this->judge = User::factory()->create();
|
||||
$this->vote = JudgeAdvancementVote::create([
|
||||
'entry_id' => $this->entry->id,
|
||||
'user_id' => $this->judge->id,
|
||||
'vote' => 'yes',
|
||||
]);
|
||||
});
|
||||
|
||||
it('returns its entry', function () {
|
||||
expect($this->vote->entry->id)->toEqual($this->entry->id);
|
||||
});
|
||||
|
||||
it('returns its judge', function () {
|
||||
expect($this->vote->judge->id)->toEqual($this->judge->id);
|
||||
});
|
||||
Loading…
Reference in New Issue