mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Begin additional test case
This commit is contained in:
parent
12fd9cd97a
commit
7b31df7c14
|
@ -3,11 +3,13 @@
|
|||
namespace Tests\Feature\Checkins\Api;
|
||||
|
||||
use App\Models\Accessory;
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use Tests\Concerns\TestsFullMultipleCompaniesSupport;
|
||||
use Tests\Concerns\TestsPermissionsRequirement;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AccessoryCheckinTest extends TestCase implements TestsPermissionsRequirement
|
||||
class AccessoryCheckinTest extends TestCase implements TestsFullMultipleCompaniesSupport, TestsPermissionsRequirement
|
||||
{
|
||||
public function testRequiresPermission()
|
||||
{
|
||||
|
@ -17,4 +19,24 @@ class AccessoryCheckinTest extends TestCase implements TestsPermissionsRequireme
|
|||
->postJson(route('api.accessories.checkin', $accessory))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testAdheresToFullMultipleCompaniesSupportScoping()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
|
||||
$this->withoutExceptionHandling();
|
||||
|
||||
[$companyA, $companyB] = Company::factory()->count(2)->create();
|
||||
|
||||
$userInCompanyA = User::factory()->for($companyA)->checkinAccessories()->create();
|
||||
$accessoryForCompanyB = Accessory::factory()->for($companyB)->checkedOutToUser()->create();
|
||||
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
|
||||
$this->actingAsForApi($userInCompanyA)
|
||||
->postJson(route('api.accessories.checkin', $accessoryForCompanyB))
|
||||
->assertStatusMessageIs('error');
|
||||
|
||||
// @todo:
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue