Skip to content

A free open source IT asset/license management system

Fill test

Marcus Moore0be05f08ec60
diff --git a/app/Http/Controllers/Reports/CustomAccessoryReportController.php b/app/Http/Controllers/Reports/CustomAccessoryReportController.php
index cc2eac87fe..8a237c02df 100644
--- a/app/Http/Controllers/Reports/CustomAccessoryReportController.php
+++ b/app/Http/Controllers/Reports/CustomAccessoryReportController.php
@@ -9,6 +9,8 @@ class CustomAccessoryReportController extends Controller
{
public function show(Request $request)
{
+ $this->authorize('reports.view');
+
return view('reports.custom.accessory');
}
diff --git a/tests/Feature/Reporting/Custom/CustomAccessoryReportTest.php b/tests/Feature/Reporting/Custom/CustomAccessoryReportTest.php
index 656b4af387..c6906e2d28 100644
--- a/tests/Feature/Reporting/Custom/CustomAccessoryReportTest.php
+++ b/tests/Feature/Reporting/Custom/CustomAccessoryReportTest.php
@@ -2,13 +2,21 @@
namespace Tests\Feature\Reporting\Custom;
+use App\Models\User;
use PHPUnit\Framework\Attributes\Group;
use Tests\TestCase;
#[Group('custom-reporting')]
class CustomAccessoryReportTest extends TestCase
{
- public function test_requires_permission()
+ public function test_requires_permission_to_view_page()
+ {
+ $this->actingAs(User::factory()->create())
+ ->get(route('reports.custom.accessory'))
+ ->assertForbidden();
+ }
+
+ public function test_requires_permission_to_run_report()
{
$this->markTestIncomplete();
}
diff --git a/tests/Feature/Reporting/Custom/CustomAssetReportTest.php b/tests/Feature/Reporting/Custom/CustomAssetReportTest.php
index dca8fb83b4..7d8836e228 100644
--- a/tests/Feature/Reporting/Custom/CustomAssetReportTest.php
+++ b/tests/Feature/Reporting/Custom/CustomAssetReportTest.php
@@ -50,13 +50,18 @@ class CustomAssetReportTest extends TestCase implements TestsPermissionsRequirem
);
}
- public function test_requires_permission()
+ public function test_requires_permission_to_view_page()
{
$this->actingAs(User::factory()->create())
->get(route('reports/custom'))
->assertForbidden();
}
+ public function test_requires_permission_to_run_report()
+ {
+ $this->markTestIncomplete();
+ }
+
public function test_can_load_custom_report_page()
{
$this->actingAs(User::factory()->canViewReports()->create())