0
votes

I created test for CompanyController,

public function testCompanyIndex()
    {
        $user = factory(User::class)->create();
        $response = $this->actingAs($user, 'web')->get('company/index');
        $response->assertStatus('200');
    }

but i have an error:

1) Tests\Feature\CompanyTest::testCompanyIndex Expected status code 200 but received 200. Failed asserting that false is true.

In CompanyController i have middleware auth:web.CompanyController@index returns all Companies.

1
just remove '' like this $response->assertStatus(200); - Gaurav Gupta

1 Answers

3
votes

just remove quotes like this $response->assertStatus(200); for more details click here