From 02c22c9efba82a6412d820741a2c04012ece21cf Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 22 Oct 2024 16:52:59 -0700 Subject: [PATCH] Add test case --- .../Feature/ReportTemplates/ShowReportTemplateTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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')); + + } }