Corrige autorizacao transaccional e valida modulos implementados
This commit is contained in:
@@ -486,3 +486,21 @@ test('equipment cannot bypass technical finance or investment budget requirement
|
||||
$this->actingAs($this->buyer)->post($this->awardUrl, $this->selection)->assertSessionHasErrors($missing === 'technical' ? 'technical' : ($missing === 'finance' ? 'approvals' : 'investment'));
|
||||
expect(PurchaseAward::query()->count())->toBe(0);
|
||||
})->with(['technical', 'finance', 'budget']);
|
||||
|
||||
test('purchase issuance rechecks a revoked procurement role inside transaction', function () {
|
||||
$award = selectPurchaseAward($this);
|
||||
approvePurchaseAward($this, $award);
|
||||
$this->actingAs($this->buyer);
|
||||
DB::table('users')->where('id', $this->buyer->id)->update(['purchasing_role' => 'warehouse']);
|
||||
$this->post('/adjudicacoes/'.$award->id.'/emitir')->assertForbidden();
|
||||
expect(PurchaseOrder::query()->count())->toBe(0);
|
||||
});
|
||||
|
||||
test('final approval rechecks a department head who moved departments', function () {
|
||||
$award = selectPurchaseAward($this);
|
||||
$department = Department::query()->create(['tenant_id' => $this->tenant->id, 'name' => 'Outro departamento fictício']);
|
||||
$this->actingAs($this->head);
|
||||
DB::table('users')->where('id', $this->head->id)->update(['department_id' => $department->id]);
|
||||
$this->post('/adjudicacoes/'.$award->id.'/decidir', ['decision' => 'approved'])->assertForbidden();
|
||||
expect($award->approvals()->where('decision', 'approved')->count())->toBe(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user