Files
eatvio-infra/tests/Feature/Recipe/IndexTest.php
2023-12-22 11:54:30 +03:00

37 lines
737 B
PHP

<?php
namespace Tests\Feature\Recipe;
use App\Models\Recipe;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class IndexTest extends TestCase
{
use RefreshDatabase;
private Recipe $recipe;
protected User $user;
public function setUp(): void
{
parent::setUp();
$this->user = User::factory()->create(['is_consultant' => true]);
$this->recipe = Recipe::inRandomOrder()->first();
$this->refreshApplicationWithLocale('en');
}
public function test_show_form_success()
{
$response = $this
->actingAs($this->user)
->get(route('recipe.index'));
$response
->assertOk();
}
}