$response->assertSee('Text') does not work properly if your controller action does not exists and you will get green instead of red because it's not throwing an exception
Create a Controller with php artisan make:controller Hello;
Create the route defined in web.php
Route::get('/myaction', 'Hello@hello');
hello does not exists yetpublic function test_if_controller_action_prints_hello()
{
$response = $this->get('/myaction');
$response->assertSee('Hello');
}
I'm not sure if there is much the assertion can check for. Also it is recommended to check the status of the response when you do a $this->get() or any other call.
Is this passing because the error has the word "Hello".
i.e. the assertion is correct - because "Hello" is appearing on the page (the error message itself).
Most helpful comment
Is this passing because the error has the word "Hello".
i.e. the assertion is correct - because "Hello" is appearing on the page (the error message itself).