From be6957c24b21a85607b4251dc64af0ef3de0588b Mon Sep 17 00:00:00 2001 From: Rob Gongora Date: Fri, 7 Jun 2024 16:08:51 +0200 Subject: [PATCH] adds test for output route passing an id --- .../Http/Controllers/OutputControllerTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Feature/Http/Controllers/OutputControllerTest.php b/tests/Feature/Http/Controllers/OutputControllerTest.php index bd9d6123..1d0708cb 100644 --- a/tests/Feature/Http/Controllers/OutputControllerTest.php +++ b/tests/Feature/Http/Controllers/OutputControllerTest.php @@ -49,4 +49,16 @@ public function test_delete_with_access(): void $this->assertSoftDeleted($output); } + + public function test_delete_sending_id(): void + { + $output = Output::factory()->create(); + + $this->actingAs(User::factory()->create([ + 'is_admin' => true, + ])); + + $response = $this->delete(route('collections.outputs.delete', $output->id)); + $response->assertRedirectToRoute('collections.outputs.index', $output->collection); + } }