diff --git a/tests/Feature/ReportTemplates/CreateReportTemplateTest.php b/tests/Feature/ReportTemplates/CreateReportTemplateTest.php index 073b4ab900..f271a16747 100644 --- a/tests/Feature/ReportTemplates/CreateReportTemplateTest.php +++ b/tests/Feature/ReportTemplates/CreateReportTemplateTest.php @@ -4,11 +4,12 @@ namespace Tests\Feature\ReportTemplates; use App\Models\ReportTemplate; use App\Models\User; +use Tests\Concerns\TestsPermissionsRequirement; use Tests\TestCase; -class CreateReportTemplateTest extends TestCase +class CreateReportTemplateTest extends TestCase implements TestsPermissionsRequirement { - public function testSavingReportTemplateRequiresCorrectPermission() + public function testRequiresPermission() { $this->actingAs(User::factory()->create()) ->post(route('report-templates.store')) diff --git a/tests/Feature/ReportTemplates/DeleteReportTemplateTest.php b/tests/Feature/ReportTemplates/DeleteReportTemplateTest.php index 8940e9fa60..e5f8310e96 100644 --- a/tests/Feature/ReportTemplates/DeleteReportTemplateTest.php +++ b/tests/Feature/ReportTemplates/DeleteReportTemplateTest.php @@ -4,11 +4,12 @@ namespace Tests\Feature\ReportTemplates; use App\Models\ReportTemplate; use App\Models\User; +use Tests\Concerns\TestsPermissionsRequirement; use Tests\TestCase; -class DeleteReportTemplateTest extends TestCase +class DeleteReportTemplateTest extends TestCase implements TestsPermissionsRequirement { - public function testDeletingReportTemplateRequiresCorrectPermission() + public function testRequiresPermission() { $this->actingAs(User::factory()->create()) ->post(route('report-templates.destroy', 1)) diff --git a/tests/Feature/ReportTemplates/ShowReportTemplateTest.php b/tests/Feature/ReportTemplates/ShowReportTemplateTest.php index 477ef90112..21f7d9d89a 100644 --- a/tests/Feature/ReportTemplates/ShowReportTemplateTest.php +++ b/tests/Feature/ReportTemplates/ShowReportTemplateTest.php @@ -4,10 +4,18 @@ namespace Tests\Feature\ReportTemplates; use App\Models\ReportTemplate; use App\Models\User; +use Tests\Concerns\TestsPermissionsRequirement; use Tests\TestCase; -class ShowReportTemplateTest extends TestCase +class ShowReportTemplateTest extends TestCase implements TestsPermissionsRequirement { + public function testRequiresPermission() + { + $this->actingAs(User::factory()->create()) + ->get(route('reports/custom')) + ->assertForbidden(); + } + public function testCanLoadCustomReportPage() { $this->actingAs(User::factory()->canViewReports()->create()) diff --git a/tests/Feature/ReportTemplates/UpdateReportTemplateTest.php b/tests/Feature/ReportTemplates/UpdateReportTemplateTest.php index aea652924d..bade8f9c50 100644 --- a/tests/Feature/ReportTemplates/UpdateReportTemplateTest.php +++ b/tests/Feature/ReportTemplates/UpdateReportTemplateTest.php @@ -4,11 +4,12 @@ namespace Tests\Feature\ReportTemplates; use App\Models\ReportTemplate; use App\Models\User; +use Tests\Concerns\TestsPermissionsRequirement; use Tests\TestCase; -class UpdateReportTemplateTest extends TestCase +class UpdateReportTemplateTest extends TestCase implements TestsPermissionsRequirement { - public function testUpdatingReportTemplateRequiresCorrectPermission() + public function testRequiresPermission() { $this->actingAs(User::factory()->create()) ->post(route('report-templates.update', 1))