forked from eatvio/eatvio-infra
37 lines
714 B
PHP
37 lines
714 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
|
|
{
|
|
$this->refreshApplicationWithLocale('en');
|
|
|
|
$this->user = User::factory()->create(['is_consultant' => true]);
|
|
$this->recipe = Recipe::inRandomOrder()->first();
|
|
}
|
|
|
|
public function test_index_page_success()
|
|
{
|
|
$response = $this
|
|
->actingAs($this->user)
|
|
->get(route('recipe.index'));
|
|
|
|
$response
|
|
->assertOk();
|
|
}
|
|
}
|
|
|