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

36 lines
704 B
PHP

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