Files
eatvio-infra/tests/Feature/Recipe/ShowTest.php

36 lines
720 B
PHP

<?php
namespace Tests\Feature\Recipe;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
use App\Models\Recipe;
class ShowTest 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_show_page_success()
{
$response = $this->actingAs($this->user)
->get(route('recipe.show', $this->recipe, false));
$response
->assertOk();
}
}