forked from eatvio/eatvio-infra
added tests for diets
This commit is contained in:
31
tests/Feature/Diet/ShowTest.php
Normal file
31
tests/Feature/Diet/ShowTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Diet;
|
||||
|
||||
use Tests\TestCase;
|
||||
use App\Models\User;
|
||||
use App\Models\Diet;
|
||||
|
||||
class ShowTest extends TestCase
|
||||
{
|
||||
protected User $user;
|
||||
private Diet $diet;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->refreshApplicationWithLocale('en');
|
||||
|
||||
$this->user = User::factory()->create(['is_consultant' => true]);
|
||||
$this->diet = Diet::inRandomOrder()->first();
|
||||
}
|
||||
|
||||
public function test_show_page_success(): void
|
||||
{
|
||||
$response = $this
|
||||
->actingAs($this->user)
|
||||
->get(route('diet.show', $this->diet));
|
||||
|
||||
$response
|
||||
->assertOk();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user