@@ -290,6 +290,30 @@ class PortalServicesTest extends TestCase
|
||||
$this->assertDatabaseCount('portal_resource_revisions', 8);
|
||||
}
|
||||
|
||||
public function test_qa_library_preserves_an_original_without_inventing_a_topic_or_auto_publishing(): void
|
||||
{
|
||||
Storage::fake('local');
|
||||
$manager = User::factory()->create();
|
||||
config(['portal.managers' => [$manager->email], 'portal.legacy_content_qa_enabled' => false]);
|
||||
$this->actingAs($manager)->post('/management/portal-services/upload', [
|
||||
'file' => UploadedFile::fake()->createWithContent('original-image-reference.txt', 'Synthetic original without a thematic classification.'),
|
||||
])->assertSessionHasNoErrors();
|
||||
$document = DB::table('documents')->firstOrFail();
|
||||
$payload = [...$this->documentResourcePayload($document->id, 'Original sem assunto'), 'topic' => '', 'category' => 'media',
|
||||
'associations' => [], 'data_classification' => 'public'];
|
||||
$this->post('/management/portal-services/resources', $payload)->assertSessionHasErrors('topic');
|
||||
$this->assertDatabaseCount('portal_resources', 0);
|
||||
config(['portal.legacy_content_qa_enabled' => true]);
|
||||
$this->post('/management/portal-services/resources', $payload)->assertSessionHasNoErrors();
|
||||
$resource = DB::table('portal_resources')->firstOrFail();
|
||||
$this->assertSame('', $resource->topic);
|
||||
$this->assertFalse($resource->published);
|
||||
$this->assertDatabaseCount('portal_resource_links', 0);
|
||||
$this->get('/documentos/'.$resource->id.'/download')->assertNotFound();
|
||||
$this->post('/management/portal-services/resources/'.$resource->id, ['published' => true])->assertSessionHasNoErrors();
|
||||
$this->get('/documentos/'.$resource->id.'/download')->assertOk();
|
||||
}
|
||||
|
||||
public function test_manager_classifies_a_reviewed_document_public_before_separate_publication(): void
|
||||
{
|
||||
Storage::fake('local');
|
||||
|
||||
Reference in New Issue
Block a user