dimanche 29 avril 2018

Testing sessions laravel 5.* assertSessionHas('flash_notification.level', 'success')

i use laracasts/flash package for session messages, i want to test if it's work as it should be, i use those lines in my tests :

$response->assertRedirect('backend/brand'); // it works

$response->assertSessionHas('flash_notification.level', 'success'); // failure
$response->assertSessionHas('flash_notification.message', 'New post has been created.');

when running my tests, i get this failure message : Failed asserting that null matches expected 'success'.

any ideas/hints why the test failure?!

Aucun commentaire:

Enregistrer un commentaire