Make projects depend on templates
This commit is contained in:
@@ -43,6 +43,7 @@ class ProjectApiTest extends TestCase
|
||||
|
||||
$this->withApplicationKey($user)
|
||||
->postJson(route('api.projects.store'), [
|
||||
'creation_mode' => 'scratch',
|
||||
'key' => 'api',
|
||||
'name' => 'API Project',
|
||||
])
|
||||
@@ -52,8 +53,11 @@ class ProjectApiTest extends TestCase
|
||||
->assertJsonPath('meta.message', 'API Project was created.');
|
||||
|
||||
$project = Project::query()->where('key', 'API')->firstOrFail();
|
||||
$project->refresh();
|
||||
|
||||
$this->assertSame(2, $project->ticketTypes()->count());
|
||||
$this->assertSame(1, $project->ticketStatuses()->count());
|
||||
$this->assertNotNull($project->project_template_id);
|
||||
}
|
||||
|
||||
public function test_users_can_create_projects_from_templates_via_api(): void
|
||||
@@ -96,6 +100,9 @@ class ProjectApiTest extends TestCase
|
||||
|
||||
$project = Project::query()->where('key', 'TPL1')->firstOrFail();
|
||||
|
||||
$project->refresh();
|
||||
|
||||
$this->assertSame($template->id, $project->project_template_id);
|
||||
$this->assertFalse($project->show_author);
|
||||
$this->assertFalse($project->show_story_points);
|
||||
$this->assertSame(['Spike'], $project->ticketTypes()->pluck('name')->all());
|
||||
|
||||
Reference in New Issue
Block a user