Skip to content

A free open source IT asset/license management system

Custom Report Templates: Updated failing test from new redirect behavior

snipe075e715428cc
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 49f968ceee..83cd8c83b5 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -9450,6 +9450,18 @@ parameters:
count: 1
path: app/Presenters/DepreciationReportPresenter.php
+ -
+ message: '#^Access to an undefined property App\\Presenters\\GroupPresenter\:\:\$display_name\.$#'
+ identifier: property.notFound
+ count: 2
+ path: app/Presenters/GroupPresenter.php
+
+ -
+ message: '#^Access to an undefined property App\\Presenters\\GroupPresenter\:\:\$id\.$#'
+ identifier: property.notFound
+ count: 1
+ path: app/Presenters/GroupPresenter.php
+
-
message: '#^Access to an undefined property App\\Presenters\\LicensePresenter\:\:\$display_name\.$#'
identifier: property.notFound
diff --git a/tests/Feature/ReportTemplates/EditReportTemplateTest.php b/tests/Feature/ReportTemplates/EditReportTemplateTest.php
index 63d1eed90b..ba8039ba1d 100644
--- a/tests/Feature/ReportTemplates/EditReportTemplateTest.php
+++ b/tests/Feature/ReportTemplates/EditReportTemplateTest.php
@@ -38,13 +38,17 @@ class EditReportTemplateTest extends TestCase implements TestsPermissionsRequire
->assertRedirectToRoute('report-templates.show', $reportTemplate->id);
}
- public function test_can_load_edit_report_template_page()
+ public function test_edit_route_redirects_to_show_which_renders_for_owner()
{
$user = User::factory()->canViewReports()->create();
$reportTemplate = ReportTemplate::factory()->for($user, 'creator')->create();
$this->actingAs($user)
->get(route('report-templates.edit', $reportTemplate))
+ ->assertRedirectToRoute('report-templates.show', $reportTemplate->id);
+
+ $this->actingAs($user)
+ ->get(route('report-templates.show', $reportTemplate))
->assertOk();
}
}