I'm at this lesson https://laracasts.com/series/build-a-laravel-app-with-tdd/episodes/16 minute 11:00
when i launch this test i get a different error than the course one
public function test_a_user_can_update_a_project()
{
$this->signIn();
$this->withoutExceptionHandling();
$project = Project::factory()->create(['owner_id'=>auth()->id()]);
$this->patch($project->path(),[
'notes'=>'Changed'
]);
$this->assertDatabaseHas('projects',['notes'=>'Changed']);
}
gives me following errors:
- Tests\Feature\ManageProjectsTest::test_a_user_can_update_a_project
Illuminate\Session\TokenMismatchException: CSRF token mismatch.
this is my route web:
Route::group(['middleware'=>'auth'],function(){
Route::get('/projects', [ProjectsController::class, 'index']);
Route::get('/projects/create', [ProjectsController::class, 'create']);
Route::get('/projects/{project}', [ProjectsController::class, 'show']);
Route::patch('/projects/{project}', [ProjectsController::class, 'update']);
Route::post('/projects', [ProjectsController::class, 'store']);
Route::post('/projects/{project}/tasks', [ProjectTasksController::class, 'store']);
Route::patch('/projects/{project}/tasks/{task}', [ProjectTasksController::class, 'update']);
});