Http test redirecting to \ instead of login

Posted 5 months ago by ddw147

Hi I am trying out testing in laravel5.6, but when try to test invalid login like below

public function testInvalidLogin()
        $response = $this->post('/login',[ 'email'=>'[email protected]', 'password'=>'secret' ]);

but when i run this i got error

Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@


Tests: 3, Assertions: 5, Failures: 1.

I have also use followingRedirects() but it is giving response code 200 and content of '/'

can you help me what is wrong here

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

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.