From 74fbc238230cabc1c44ab1933c65fe48effda13f Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 21 Aug 2024 10:09:35 +0100 Subject: [PATCH] Updated tests Signed-off-by: snipe --- tests/Feature/Locations/Ui/CreateLocationsTest.php | 3 ++- tests/Feature/Locations/Ui/UpdateLocationsTest.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Feature/Locations/Ui/CreateLocationsTest.php b/tests/Feature/Locations/Ui/CreateLocationsTest.php index c6813c26b8..cfcb849025 100644 --- a/tests/Feature/Locations/Ui/CreateLocationsTest.php +++ b/tests/Feature/Locations/Ui/CreateLocationsTest.php @@ -38,11 +38,12 @@ class CreateLocationsTest extends TestCase $this->assertFalse(Location::where('name', 'Test Location')->exists()); $this->actingAs(User::factory()->superuser()->create()) + ->from(route('locations.create')) ->post(route('locations.store'), [ 'name' => 'Test Location', 'parent_id' => '100000000' ]) - ->assertRedirect(route('locations.index')); + ->assertRedirect(route('locations.create')); $this->assertFalse(Location::where('name', 'Test Location')->exists()); } diff --git a/tests/Feature/Locations/Ui/UpdateLocationsTest.php b/tests/Feature/Locations/Ui/UpdateLocationsTest.php index f8fa934b36..c692374cc7 100644 --- a/tests/Feature/Locations/Ui/UpdateLocationsTest.php +++ b/tests/Feature/Locations/Ui/UpdateLocationsTest.php @@ -61,7 +61,7 @@ class UpdateLocationsTest extends TestCase 'name' => 'Test Location', 'parent_id' => '100000000' ]) - ->assertRedirect(route('locations.index')); + ->assertRedirect(route('locations.edit', ['location' => $location->id])); $this->followRedirects($response)->assertSee(trans('general.error')); $this->assertFalse(Location::where('name', 'Test Location')->exists());