added plan index, edit tests

This commit is contained in:
2023-12-28 15:54:16 +03:00
parent e7fb36de2e
commit 73ad8bb645
2 changed files with 238 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?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;
private $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()
{
$response = $this
->actingAs($this->user)
->get(route('plan.index'));
$response
->assertOk();
}
}