diff --git a/tests/Feature/app/Models/BonusScoreTest.php b/tests/Feature/app/Models/BonusScoreTest.php new file mode 100644 index 0000000..857ee95 --- /dev/null +++ b/tests/Feature/app/Models/BonusScoreTest.php @@ -0,0 +1,38 @@ +audition = Audition::factory()->create(); + $this->judge = User::factory()->create(); + $this->bonusScoreDefinition = BonusScoreDefinition::factory()->create(); + $this->bonusScoreDefinition->auditions()->attach($this->audition); + $this->bonusScoreDefinition->judges()->attach($this->judge); + $this->entry = Entry::factory()->create(['audition_id' => $this->audition->id]); + DB::table('bonus_scores')->insert([ + 'entry_id' => $this->entry->id, + 'user_id' => $this->judge->id, + 'originally_scored_entry' => $this->entry->id, + 'score' => 28, + ]); +}); + +it('can return its entry', function () { + expect(BonusScore::first()->entry->id)->toEqual($this->entry->id); +}); + +it('can return its judge', function () { + expect(BonusScore::first()->judge->id)->toEqual($this->judge->id); +}); + +it('can return its originally scored entry', function () { + expect(BonusScore::first()->originallyScoredEntry->id)->toEqual($this->entry->id); +});