From 34636016ebc6d54b87fba061bb8cf6eead916204 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 12 Jun 2025 12:47:03 -0700 Subject: [PATCH] Improve test --- .../Feature/Categories/Ui/CreateCategoriesTest.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/Feature/Categories/Ui/CreateCategoriesTest.php b/tests/Feature/Categories/Ui/CreateCategoriesTest.php index 694b61c613..f2a45c6116 100644 --- a/tests/Feature/Categories/Ui/CreateCategoriesTest.php +++ b/tests/Feature/Categories/Ui/CreateCategoriesTest.php @@ -34,11 +34,20 @@ class CreateCategoriesTest extends TestCase ->post(route('categories.store'), [ 'name' => 'Test Category', 'category_type' => 'asset', - 'notes' => 'Test Note', + 'eula_text' => 'Sample text', + 'require_acceptance' => '1', + 'notes' => 'My Note', ]) ->assertRedirect(route('categories.index')); - $this->assertTrue(Category::where('name', 'Test Category')->where('notes', 'Test Note')->exists()); + $this->assertDatabaseHas('categories', [ + 'name' => 'Test Category', + 'category_type' => 'asset', + 'eula_text' => 'Sample text', + 'notes' => 'My Note', + 'require_acceptance' => 1, + 'alert_on_response' => 0, + ]); } public function testUserCannotCreateCategoriesWithInvalidType()