From 39bb2c2adbd28f267f880de914417893918a9090 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 20 Feb 2025 12:49:58 -0800 Subject: [PATCH] Implement tests --- tests/Feature/Notes/CreateNotesTest.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/Feature/Notes/CreateNotesTest.php b/tests/Feature/Notes/CreateNotesTest.php index fac13c1ac8..84c8ec34bf 100644 --- a/tests/Feature/Notes/CreateNotesTest.php +++ b/tests/Feature/Notes/CreateNotesTest.php @@ -19,7 +19,25 @@ class CreateNotesTest extends TestCase public function testValidation() { - $this->markTestIncomplete(); + $asset = Asset::factory()->create(); + + $this->actingAs(User::factory()->editAssets()->create()) + ->post(route('notes.store'), [ + 'id' => $asset->id, + // should be more... + ]) + ->assertSessionHas('errors'); + } + + public function testAssetMustExist() + { + $this->actingAs(User::factory()->editAssets()->create()) + ->post(route('notes.store'), [ + 'id' => 999_999, + 'type' => 'asset', + 'note' => 'my note', + ]) + ->assertStatus(404); } public function testCanCreateNoteForAsset()