A free open source IT asset/license management system
Implement test for viewing shared template
Marcus Moore1451843f84b2
diff --git a/tests/Feature/ReportTemplates/ShowReportTemplateTest.php b/tests/Feature/ReportTemplates/ShowReportTemplateTest.phpindex 0e6e93b0cd..7c33577acc 100644--- a/tests/Feature/ReportTemplates/ShowReportTemplateTest.php+++ b/tests/Feature/ReportTemplates/ShowReportTemplateTest.php@@ -43,6 +43,17 @@ class ShowReportTemplateTest extends TestCase implements TestsPermissionsRequirepublic function testCanLoadAnotherUsersSavedReportTemplateIfShared(){- $this->markTestIncomplete();+ $user = User::factory()->canViewReports()->create();+ $reportTemplate = ReportTemplate::factory()->shared()->make(['name' => 'My Awesome Template']);+ $user->reportTemplates()->save($reportTemplate);++ $this->actingAs(User::factory()->canViewReports()->create())+ ->get(route('report-templates.show', $reportTemplate))+ ->assertOk()+ ->assertViewHas([+ 'template' => function (ReportTemplate $templatePassedToView) use ($reportTemplate) {+ return $templatePassedToView->is($reportTemplate);+ }+ ]);}}