diff --git a/tests/Feature/Plan/EditTest.php b/tests/Feature/Plan/EditTest.php index a75bd88..d878c36 100644 --- a/tests/Feature/Plan/EditTest.php +++ b/tests/Feature/Plan/EditTest.php @@ -36,12 +36,23 @@ class EditTest extends TestCase { $plan = $this->plan; $plan->author()->attach($this->user->id); + $response = $this + ->actingAs($this->user) + ->get(route('plan.edit', $plan)); + $response->assertSuccessful(); + } + + public function test_show_form_edit_plan_fail_for_not_author(): void + { + $plan = $this->plan; + $user = User::factory()->create(); + $plan->author()->attach($user->id); $response = $this ->actingAs($this->user) ->get(route('plan.edit', $plan)); - $response->assertSuccessful(); + $response->assertForbidden(); } public function test_publish_new_plan_success(): void