forked from eatvio/eatvio-infra
added test for not author user
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user