forked from eatvio/eatvio-infra
added index test recipe
This commit is contained in:
36
tests/Feature/Recipe/IndexTest.php
Normal file
36
tests/Feature/Recipe/IndexTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user