added test for not author user

This commit is contained in:
2024-01-19 00:21:50 +03:00
parent 8d1aee4995
commit 06f5aaaa96

View File

@@ -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