added tests for blogPost

This commit is contained in:
2024-01-10 13:41:43 +03:00
parent d96954f4b4
commit 93ca684f67
22 changed files with 548 additions and 28 deletions

View File

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