Level 39
What's the value of $thread->title? (blanc or null?)
1 like
I'm following along with the Let's Build a Forum series, while adapting it to Laravel 8. I know it's a old series so maybe there's something new I'm missing with how testing works. Here's my testing class
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use App\Models\Thread;
class ThreadsTest extends TestCase
{
use RefreshDatabase;
public function test_user_can_view_threads()
{
$thread = Thread::make();
$response = $this->get('/threads');
// $response->assertOk();
$response->assertSee($thread->title);
}
}
I'm getting this warning
WARN Tests\Feature\ThreadsTest
! user can view threads → This test did not perform any assertions /var/www/html/tests/Feature/ThreadsTest.php:14
I'm not sure how assertSee is not an assertion? If I do $response->assertSee('somenonsense'); it fails as expected.
What's the value of $thread->title? (blanc or null?)
Please or to participate in this conversation.