I'm having trouble to get it to pass the test at 5min video of Build a Laravel App with TDD. This is the code:
use App\User;
use App\Models\Project;
...
/** @test */
public function a_user_can_view_their_project()
{
$this->be(factory(User::class)->create());
$this->withoutExceptionHandling();
$project = factory(Project::class)->create(['owner_id' => auth()->id()]);
$this->get($project->path())
->assertSee($project->title)
->assertSee($project->description);
}
When I run this test, it says:
There was 1 error:
- Tests\Feature\ProjectsTest::a_user_can_view_their_project
Symfony\Component\HttpKernel\Exception\HttpException
These are my routes:
Route::get('/', function () {
return view('welcome');
});
Route::get('/projects', 'ProjectsController@index')->middleware('auth');
Route::get('/projects/{project}', 'ProjectsController@show')->middleware('auth');
Route::post('/projects', 'ProjectsController@store')->middleware('auth');
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');