public function test_example()
{
$response = $this->get('/rooms');
$response->assertStatus(200)
->assertSeeText('Type')
->assertViewIs('rooms.index')
->assertViewHas('rooms');
}
i got this error
• Tests\Feature\ShowRoomsControllerTest > example
Expected status code 200 but received 500.
Failed asserting that 200 is identical to 500.
at tests/Feature/ShowRoomsControllerTest.php:20
16▕ public function test_example()
17▕ {
18▕ $response = $this->get('/rooms');
19▕
➜ 20▕ $response->assertStatus(200)
21▕ ->assertSeeText('Type')
22▕ ->assertViewIs('rooms.index')
23▕ ->assertViewHas('rooms');
24▕ }
Tests: 1 failed
Time: 0.23s
• Tests\Feature\UserTest > example
Expected status code 200 but received 500.
Failed asserting that 200 is identical to 500.
at tests/Feature/UserTest.php:21
17▕ {
18▕ $response = $this->get('/rooms');
19▕ $this->assertTrue(true);
20▕
➜ 21▕ $response->assertStatus(200);
22▕
23▕
24▕ }
25▕ }
Tests: 1 failed, 17 passed
Time: 2.93s
this is my test file
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class UserTest extends TestCase
{
/**
* A basic feature test example.
*
* @return void
*/
public function test_example()
{
$response = $this->get('/rooms');
$this->assertTrue(true);
$response->assertStatus(200);
}
}