You say the database is seeded, are you using the same database for your tests? That does not make sense if that's the case.. And there will be error in your console that should give you hints on what is going wrong. Just by looking at the code no one can tell what's wrong.
Jun 20, 2023
7
Level 63
assert not working
Hello,
I have this test.
public function test_member_can_see_the_dashboard(): void
{
$user = User::where('pseudo', 'member')->first();
$response = $this->actingAs($user)->get('dashboard');
$response->assertStatus(200);
}
I have seeded the database with test datas, the member user exists, but it cannot access the dashboard.
It should be able to access the dashboard.
That means that there is something wrong in my test.
But I really don't understand what could be wrong.
Any idea ?
Thanks a lot ;).
V
Level 73
@vincent15000 when you are seeding the users table you can set the value for email_verified_at column and then you don't need to think about the middleware again.
1 like
Please or to participate in this conversation.