make permission for plan edit only author can edit his plan

This commit is contained in:
2024-01-18 00:46:33 +03:00
parent 276e8babce
commit 8d1aee4995
8 changed files with 68 additions and 4 deletions

View File

@@ -32,11 +32,14 @@ class EditTest extends TestCase
$this->plan = Plan::factory()->create();
}
public function test_show_form_edit_plan(): void
public function test_show_form_edit_plan_success_for_author(): void
{
$plan = $this->plan;
$plan->author()->attach($this->user->id);
$response = $this
->actingAs($this->user)
->get(route('plan.edit', $this->plan));
->get(route('plan.edit', $plan));
$response->assertSuccessful();
}