27 lines
665 B
PHP
27 lines
665 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->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);
|
|
});
|