hjortur17
147
12
Testing

Session is missing expected key [errors]. Failed asserting that false is true.

Posted 1 week ago by hjortur17

Hi, I can't figure out how to get this to green. I get this error message when running this method

ERROR:

Session is missing expected key [errors].
Failed asserting that false is true.

METHOD:

/** @test */
    public function a_reply_requires_a_body()
    {
        $this->withExceptionHandling()->signIn();

        $thread = create('App\Thread');
        $reply = make('App\Reply', ['body' => null]);

        $this->post($thread->path().'/athugasemdir', $reply->toArray())
            ->assertSessionHasErrors('body');
    }

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

Reply to

Use Markdown with GitHub-flavored code blocks.