mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-25 20:51:30 -08:00
quick push
This commit is contained in:
parent
1139ed676a
commit
b9fdb5880a
|
@ -424,4 +424,31 @@ class UpdateAssetTest extends TestCase
|
|||
$this->assertNull($asset->assigned_to);
|
||||
$this->assertNull($asset->assigned_type);
|
||||
}
|
||||
|
||||
public function testAssetCannotBeUpdatedByUserInSeparateCompany()
|
||||
{
|
||||
$this->markTestIncomplete('not done with this yet');
|
||||
|
||||
$this->settings->enableMultipleFullCompanySupport();
|
||||
|
||||
$companyA = Company::factory()->create();
|
||||
$companyB = Company::factory()->create();
|
||||
$userA = User::factory()->create([
|
||||
'company_id' => $companyA->id,
|
||||
]);
|
||||
$userB = User::factory()->create([
|
||||
'company_id' => $companyB->id,
|
||||
]);
|
||||
$asset = Asset::factory()->create([
|
||||
'user_id' => $userA->id,
|
||||
'company_id' => $companyA->id,
|
||||
]);
|
||||
|
||||
$this->actingAsForApi($userB)
|
||||
->patchJson(route('api.assets.update', $asset->id), [
|
||||
'name' => 'test name'
|
||||
])
|
||||
->assertStatus(403);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue