Exige motivo na reversão territorial e prepara novo plano
This commit is contained in:
@@ -70,7 +70,9 @@ class InvestmentTerritorialTraceabilityTest extends TestCase
|
||||
$this->assertDatabaseHas('cluster_projects', ['id' => $f['id'], 'validation_status' => $f['row']->validation_status, 'source_reference' => 'QA synthetic source']);
|
||||
$f['dossier']->update(['publication_status' => 'draft']);
|
||||
$this->assertSame([], $service->sources('economic_clusters', $f['cluster']->id));
|
||||
$this->postJson('/management/relationship-repair', [...$payload, 'reverse' => true])->assertOk()->assertJsonPath('changed', 1);
|
||||
$this->postJson('/management/relationship-repair', [...$payload, 'reverse' => true])->assertUnprocessable()->assertJsonValidationErrors(['reason', 'confirm_reverse']);
|
||||
$this->postJson('/management/relationship-repair', [...$payload, 'reverse' => true, 'reason' => 'QA reversal preservation test', 'confirm_reverse' => true])->assertOk()->assertJsonPath('changed', 1);
|
||||
$this->assertSame('QA reversal preservation test', app(InvestmentTerritorialTraceability::class)->preview()['history'][0]['reason']);
|
||||
$this->assertDatabaseHas('cluster_projects', ['id' => $f['id'], 'version_no' => $f['row']->version_no + 2, 'source_reference' => null, 'evidence_reference' => null, 'validation_status' => $f['row']->validation_status]);
|
||||
$this->assertSame([], $service->sources('economic_clusters', $f['cluster']->id));
|
||||
$this->assertSame(2, DB::table('audit_events')->where('source_system', 'territory-traceability-v2')->count());
|
||||
|
||||
Reference in New Issue
Block a user