Corrige autorizacao transaccional e valida modulos implementados
This commit is contained in:
@@ -149,3 +149,14 @@ test('budget service refuses a requisition belonging to another company', functi
|
||||
}
|
||||
expect(BudgetEntry::query()->count())->toBe(0);
|
||||
});
|
||||
|
||||
test('unapproved allocation displays no authorised or available funds', function () {
|
||||
$this->get('/orcamentos')->assertOk()->assertInertia(fn ($page) => $page->where('budgets.0.amount_minor', 20000)->where('budgets.0.approved_total_minor', 0)->where('budgets.0.available_minor', 0));
|
||||
});
|
||||
|
||||
test('initial allocation approval rechecks administrator role inside transaction', function () {
|
||||
$this->actingAs($this->approver);
|
||||
DB::table('users')->where('id', $this->approver->id)->update(['purchasing_role' => 'warehouse']);
|
||||
$this->post('/orcamentos/'.$this->budget->id.'/aprovar')->assertForbidden();
|
||||
expect($this->budget->refresh()->approved_by)->toBeNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user