Added test
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
473c684fa5
commit
185fd559c9
1 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Tests\Feature\Manufacturers\Ui;
|
namespace Tests\Feature\Manufacturers\Ui;
|
||||||
|
|
||||||
|
use App\Models\Manufacturer;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
@ -13,4 +14,15 @@ class IndexManufacturersTest extends TestCase
|
||||||
->get(route('manufacturers.index'))
|
->get(route('manufacturers.index'))
|
||||||
->assertOk();
|
->assertOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testCannotSeedIfManufacturersExist()
|
||||||
|
{
|
||||||
|
Manufacturer::factory()->create();
|
||||||
|
|
||||||
|
$this->actingAs(User::factory()->superuser()->create())
|
||||||
|
->post(route('manufacturers.seed'))
|
||||||
|
->assertStatus(302)
|
||||||
|
->assertSessionHas('error')
|
||||||
|
->assertRedirect(route('manufacturers.index'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue