feat: implement initial project, document, and resource management modules with routing, controllers, and UI components
This commit is contained in:
@@ -474,6 +474,31 @@ class ProjectWizardFlowTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function admin_can_discard_a_draft_project(): void
|
||||
{
|
||||
$draft = Project::factory()->create(['current_wizard_step' => 3]);
|
||||
|
||||
$this->actingAs($this->admin)
|
||||
->delete(route('projects.discard', $draft))
|
||||
->assertRedirect(route('projects.index'))
|
||||
->assertSessionHas('success');
|
||||
|
||||
$this->assertSoftDeleted('projects', ['id' => $draft->id]);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function completed_wizard_projects_cannot_be_discarded(): void
|
||||
{
|
||||
$project = Project::factory()->create(['current_wizard_step' => 7]);
|
||||
|
||||
$this->actingAs($this->admin)
|
||||
->delete(route('projects.discard', $project))
|
||||
->assertSessionHas('error');
|
||||
|
||||
$this->assertDatabaseHas('projects', ['id' => $project->id, 'deleted_at' => null]);
|
||||
}
|
||||
|
||||
// ─── Status Transitions ──────────────────────────────────────────────────
|
||||
|
||||
/** @test */
|
||||
|
||||
Reference in New Issue
Block a user