refreshApplicationWithLocale('en'); Storage::fake('plans'); $this->image = UploadedFile::fake()->image('plan.png'); $this->user = User::factory()->create(['is_consultant' => true]); $this->plan = Plan::inRandomOrder()->first(); } public function test_show_page_success() { $response = $this->actingAs($this->user) ->get(route('plan.show', $this->plan, false)); $response ->assertOk(); } // When appear role for user // public function test_show_form_is_not_consultant() // { // $user = User::factory()->create(['is_consultant' => false]); // $response = $this->actingAs($this->user) // ->get('/plan/'. $this->plan->id); // $response // ->assertStatus(403); // } }