Files
eatvio-infra/tests/Feature/Product_Nutritional/IndexTest.php

36 lines
803 B
PHP

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