snipe-it/tests/Feature/Accessories/Ui/AccessoriesIndexTest.php

34 lines
859 B
PHP
Raw Normal View History

2024-09-04 15:43:01 -07:00
<?php
namespace Tests\Feature\Accessories\Ui;
use App\Models\User;
2024-12-12 14:30:58 -08:00
use Tests\Concerns\TestsPermissionsRequirement;
2024-09-04 15:43:01 -07:00
use Tests\TestCase;
2024-12-12 14:30:58 -08:00
class AccessoriesIndexTest extends TestCase implements TestsPermissionsRequirement
2024-09-04 15:43:01 -07:00
{
2024-12-12 14:30:58 -08:00
public function testRequiresPermission()
2024-09-04 15:43:01 -07:00
{
$this->actingAs(User::factory()->create())
->get(route('accessories.index'))
->assertForbidden();
}
2024-12-12 14:30:58 -08:00
2024-12-12 14:30:58 -08:00
public function testRendersAccessoriesIndexPage()
{
$this->actingAs(User::factory()->viewAccessories()->create())
->get(route('accessories.index'))
->assertOk()
->assertViewIs('accessories.index');
}
public function testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('accessories.index'))
->assertOk();
}
2024-09-04 15:43:01 -07:00
}