added edit form test recipe

This commit is contained in:
2023-12-22 10:49:17 +03:00
parent 73b2b8b25a
commit 0349e05e39

View File

@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
namespace Tests\Feature\Recipe;
use App\Models\Recipe;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
/**
* @internal
*/
final class EditFormTest extends TestCase
{
use RefreshDatabase;
protected User $user;
private Recipe $recipe;
public function setUp(): void
{
parent::setUp();
$this->user = User::factory()->create(['is_consultant' => true]);
$this->recipe = Recipe::inRandomOrder()->first();
$this->refreshApplicationWithLocale('en');
}
public function testShowFormEditRecipe(): void
{
$response = $this
->actingAs($this->user)
->get(route('recipe.edit', ['recipe' => $this->recipe->id]));
$response->assertSuccessful();
}
}