mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
Begin additional test case
This commit is contained in:
parent
12fd9cd97a
commit
7b31df7c14
|
@ -3,11 +3,13 @@
|
||||||
namespace Tests\Feature\Checkins\Api;
|
namespace Tests\Feature\Checkins\Api;
|
||||||
|
|
||||||
use App\Models\Accessory;
|
use App\Models\Accessory;
|
||||||
|
use App\Models\Company;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use Tests\Concerns\TestsFullMultipleCompaniesSupport;
|
||||||
use Tests\Concerns\TestsPermissionsRequirement;
|
use Tests\Concerns\TestsPermissionsRequirement;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
|
|
||||||
class AccessoryCheckinTest extends TestCase implements TestsPermissionsRequirement
|
class AccessoryCheckinTest extends TestCase implements TestsFullMultipleCompaniesSupport, TestsPermissionsRequirement
|
||||||
{
|
{
|
||||||
public function testRequiresPermission()
|
public function testRequiresPermission()
|
||||||
{
|
{
|
||||||
|
@ -17,4 +19,24 @@ class AccessoryCheckinTest extends TestCase implements TestsPermissionsRequireme
|
||||||
->postJson(route('api.accessories.checkin', $accessory))
|
->postJson(route('api.accessories.checkin', $accessory))
|
||||||
->assertForbidden();
|
->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