Updated tests

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-08-21 10:09:35 +01:00
parent a23dee52f2
commit 74fbc23823
2 changed files with 3 additions and 2 deletions

View file

@ -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());
}

View file

@ -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());