4 months ago

NotFoundHttpException in phpUnit caused by redirect()->route()

Posted 4 months ago by finchy70

This simple test is failing.

     * @test
    public function it_can_create_a_job()
        $client = create('App\Client');
        $job = make('App\Job', ['client_id' => $client->id]);
        $this->post('/jobs', $job->toArray())


The error is Symfony\Component\HttpKernel\Exception\NotFoundHttpException:.

This seems to be caused by the redirect at the end of my controller code.

return redirect()->route('', $job->id);

Here is the route

Route::get('/diary/{id}', '[email protected]')->name('');

It all seems to work but this failing test is annoying me. Any one got any ideas what I am missing?

Please sign in or create an account to participate in this conversation.