From 14130eb8be558abf7a307da301dca6428e4fbfef Mon Sep 17 00:00:00 2001 From: alex-chevski Date: Sat, 16 Dec 2023 23:46:38 +0300 Subject: [PATCH] added Test for show page --- tests/Feature/Plan/ShowTest.php | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 tests/Feature/Plan/ShowTest.php diff --git a/tests/Feature/Plan/ShowTest.php b/tests/Feature/Plan/ShowTest.php new file mode 100644 index 0000000..a3c60c7 --- /dev/null +++ b/tests/Feature/Plan/ShowTest.php @@ -0,0 +1,60 @@ +image = UploadedFile::fake()->image('plan.png'); + + $this->user = User::factory()->create(['is_consultant' => true]); + $this->plan = Plan::factory()->create(); + + } + + public function test_show_form_success() + { + $response = $this->actingAs($this->user) + ->get('/plan/'. $this->plan->id); + + $response + ->assertStatus(302) + ->assertRedirect('https://dev2.eatvio.com/ru'); + } + + // 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); + + // } +}