2024-09-09 14:35:38 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Feature\Accessories\Api;
|
|
|
|
|
|
|
|
use App\Models\Accessory;
|
|
|
|
use App\Models\User;
|
2024-09-16 16:35:21 -07:00
|
|
|
use Tests\Concerns\TestsPermissionsRequirement;
|
2024-09-09 14:35:38 -07:00
|
|
|
use Tests\TestCase;
|
|
|
|
|
2024-09-16 16:35:21 -07:00
|
|
|
class ShowAccessoryTest extends TestCase implements TestsPermissionsRequirement
|
2024-09-09 14:35:38 -07:00
|
|
|
{
|
2024-09-16 16:35:21 -07:00
|
|
|
public function testRequiresPermission()
|
2024-09-09 14:35:38 -07:00
|
|
|
{
|
|
|
|
$accessory = Accessory::factory()->create();
|
|
|
|
|
|
|
|
$this->actingAsForApi(User::factory()->create())
|
|
|
|
->getJson(route('api.accessories.show', $accessory))
|
|
|
|
->assertForbidden();
|
|
|
|
}
|
|
|
|
}
|