mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Added more basic tests
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
e98823f7fa
commit
8c6ecd35ec
23
tests/Feature/Components/Ui/ComponentIndexTest.php
Normal file
23
tests/Feature/Components/Ui/ComponentIndexTest.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Components\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ComponentIndexTest extends TestCase
|
||||
{
|
||||
public function testPermissionRequiredToViewComponentsList()
|
||||
{
|
||||
$this->actingAs(User::factory()->create())
|
||||
->get(route('components.index'))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testUserCanListComponents()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('components.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
23
tests/Feature/Consumables/Ui/ConsumableIndexTest.php
Normal file
23
tests/Feature/Consumables/Ui/ConsumableIndexTest.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Consumables\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ConsumableIndexTest extends TestCase
|
||||
{
|
||||
public function testPermissionRequiredToViewConsumablesList()
|
||||
{
|
||||
$this->actingAs(User::factory()->create())
|
||||
->get(route('consumables.index'))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testUserCanListConsumables()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('consumables.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
25
tests/Feature/Groups/Ui/IndexGroupTest.php
Normal file
25
tests/Feature/Groups/Ui/IndexGroupTest.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Groups\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class IndexGroupTest extends TestCase
|
||||
{
|
||||
public function testPermissionRequiredToViewGroupList()
|
||||
{
|
||||
$this->actingAs(User::factory()->create())
|
||||
->get(route('groups.index'))
|
||||
->assertForbidden();
|
||||
|
||||
//$this->followRedirects($response)->assertSee('sad-panda.png');
|
||||
}
|
||||
|
||||
public function testUserCanListGroups()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('groups.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
23
tests/Feature/Licenses/Ui/LicenseIndexTest.php
Normal file
23
tests/Feature/Licenses/Ui/LicenseIndexTest.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Licenses\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class LicenseIndexTest extends TestCase
|
||||
{
|
||||
public function testPermissionRequiredToViewLicenseList()
|
||||
{
|
||||
$this->actingAs(User::factory()->create())
|
||||
->get(route('licenses.index'))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testUserCanListLicenses()
|
||||
{
|
||||
$this->actingAs(User::factory()->superuser()->create())
|
||||
->get(route('licenses.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue