actingAs(User::factory()->create()) ->get(route('report-templates.edit', ReportTemplate::factory()->create())) ->assertForbidden(); } public function testCannotLoadEditPageForAnotherUsersReportTemplate() { $this->markTestIncomplete('Returns 404...'); $user = User::factory()->canViewReports()->create(); $reportTemplate = ReportTemplate::factory()->create(); $this->actingAs($user) ->get(route('report-templates.edit', $reportTemplate)) ->assertSessionHas('error') ->assertRedirect(route('reports/custom')); } public function testCanLoadEditReportTemplatePage() { $user = User::factory()->canViewReports()->create(); $reportTemplate = ReportTemplate::factory()->for($user)->create(); $this->actingAs($user) ->get(route('report-templates.edit', $reportTemplate)) ->assertOk(); } }