Skip to content

A free open source IT asset/license management system

Add test case

Marcus Moore02c22c9efba8
diff --git a/tests/Feature/ReportTemplates/ShowReportTemplateTest.php b/tests/Feature/ReportTemplates/ShowReportTemplateTest.php
index 21f7d9d89a..1bd63daee6 100644
--- a/tests/Feature/ReportTemplates/ShowReportTemplateTest.php
+++ b/tests/Feature/ReportTemplates/ShowReportTemplateTest.php
@@ -40,4 +40,14 @@ class ShowReportTemplateTest extends TestCase implements TestsPermissionsRequire
return $templatePassedToView->is($reportTemplate);
}]);
}
+
+ public function testCannotLoadAnotherUsersSavedReportTemplate()
+ {
+ $reportTemplate = ReportTemplate::factory()->create();
+
+ $this->actingAs(User::factory()->canViewReports()->create())
+ ->get(route('report-templates.show', $reportTemplate))
+ ->assertRedirect(route('reports/custom'));
+
+ }
}