From 86f13a9735358ce0ce51205a439ce8fc7df5197c Mon Sep 17 00:00:00 2001
From: Marcus Moore <contact@marcusmoore.io>
Date: Wed, 18 Sep 2024 16:13:34 -0700
Subject: [PATCH] Add index test

---
 .../Feature/Accessories/Api/IndexAccessoryTest.php | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tests/Feature/Accessories/Api/IndexAccessoryTest.php b/tests/Feature/Accessories/Api/IndexAccessoryTest.php
index 999c0f97ff..96263f5380 100644
--- a/tests/Feature/Accessories/Api/IndexAccessoryTest.php
+++ b/tests/Feature/Accessories/Api/IndexAccessoryTest.php
@@ -53,4 +53,18 @@ class IndexAccessoryTest extends TestCase implements TestsFullMultipleCompaniesS
             ->assertResponseContainsInRows($accessoryB)
             ->assertResponseContainsInRows($accessoryC);
     }
+
+    public function testCanGetAccessories()
+    {
+        $user = User::factory()->viewAccessories()->create();
+
+        $accessoryA = Accessory::factory()->create(['name' => 'Accessory A']);
+        $accessoryB = Accessory::factory()->create(['name' => 'Accessory B']);
+
+        $this->actingAsForApi($user)
+            ->getJson(route('api.accessories.index'))
+            ->assertOk()
+            ->assertResponseContainsInRows($accessoryA)
+            ->assertResponseContainsInRows($accessoryB);
+    }
 }