diff --git a/app/Models/HistoricalSeat.php b/app/Models/HistoricalSeat.php index 7403cff..916ea6d 100644 --- a/app/Models/HistoricalSeat.php +++ b/app/Models/HistoricalSeat.php @@ -2,14 +2,11 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; class HistoricalSeat extends Model { - use HasFactory; - protected $guarded = []; public function student(): BelongsTo diff --git a/tests/Feature/app/Actions/Tabulation/HistoricalSeatTest.php b/tests/Feature/app/Actions/Tabulation/HistoricalSeatTest.php new file mode 100644 index 0000000..5cf6ae6 --- /dev/null +++ b/tests/Feature/app/Actions/Tabulation/HistoricalSeatTest.php @@ -0,0 +1,21 @@ +student = Student::factory()->create(); + HistoricalSeat::create([ + 'student_id' => $this->student->id, + 'year' => 8, + 'seat_description' => 'First Seat', + ]); +}); + +it('Returns its student', function () { + expect(HistoricalSeat::first()->student->id)->toEqual($this->student->id) + ->and(HistoricalSeat::first()->student)->toBeInstanceOf(Student::class); +});