mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-17 02:54:06 -08:00
a6b2f5df1d
Signed-off-by: snipe <snipe@snipe.net>
27 lines
698 B
PHP
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 testUserCanListConsumables()
|
|
{
|
|
$consumable = Consumable::factory()->create();
|
|
$this->actingAs(User::factory()->superuser()->create())
|
|
->get(route('consumables.show', $consumable))
|
|
->assertOk();
|
|
}
|
|
}
|