Added main login tests

This commit is contained in:
Sergio Brighenti 2020-10-03 16:38:19 +02:00
parent 125ae162ff
commit 89a19006ad
2 changed files with 6 additions and 6 deletions

View file

@ -75,6 +75,7 @@ class LoginControllerTest extends TestCase
->form([
'username' => 'admin@example.com',
'password' => 'admin',
'remember' => 'on',
], 'POST');
$this->submitForm($form);
@ -84,8 +85,9 @@ class LoginControllerTest extends TestCase
}
/** @test */
public function it_set_the_remember_token()
public function it_redirects_to()
{
$this->app->getContainer()->get('session')->set('redirectTo', route('profile'));
$this->createAdminUser();
$response = $this->get(route('login.show'));
@ -97,9 +99,7 @@ class LoginControllerTest extends TestCase
'remember' => 'on',
], 'POST');
$response = $this->submitForm($form);
dd($response->getHeaders());
$redirect = $this->submitForm($form)->getHeaderLine('Location');
$this->assertSame(route('profile'), $redirect);
}
}

View file

@ -1,7 +1,7 @@
<?php
return [
'base_path' => 'http://localhost',
'base_url' => 'http://localhost',
'debug' => true,
'db' =>
[