3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-03-08 01:19:32 +00:00
Files
snipe-it/tests/Feature/Consumables/Ui/ConsumableViewTest.php
2024-12-16 17:45:10 -08:00

27 lines
698 B
PHP

<?php
namespace Tests\Feature\Consumables\Ui;
use App\Models\Consumable;
use App\Models\User;
use Tests\TestCase;
class ConsumableViewTest extends TestCase
{
public function testPermissionRequiredToViewConsumable()
{
$consumable = Consumable::factory()->create();
$this->actingAs(User::factory()->create())
->get(route('consumables.show', $consumable))
->assertForbidden();
}
public function testUserCanViewAConsumable()
{
$consumable = Consumable::factory()->create();
$this->actingAs(User::factory()->superuser()->create())
->get(route('consumables.show', $consumable))
->assertOk();
}
}