Expand exception code and fix demo user redirect.

This commit is contained in:
James Cole
2018-03-07 05:51:51 +01:00
parent f349aa47ce
commit d52d8d7970
10 changed files with 22 additions and 22 deletions

View File

@@ -49,7 +49,6 @@ class AuthenticateTest extends TestCase
public function testMiddlewareAjax()
{
Log::debug('Now at testMiddlewareAjax');
//$this->withoutExceptionHandling();
$server = ['HTTP_X-Requested-With' => 'XMLHttpRequest'];
$response = $this->get('/_test/authenticate', $server);
$this->assertEquals(Response::HTTP_UNAUTHORIZED, $response->getStatusCode());
@@ -89,15 +88,14 @@ class AuthenticateTest extends TestCase
public function testMiddlewareEmail()
{
Log::debug('Now at testMiddlewareEmail');
//$this->withoutExceptionHandling();
$user = $this->user();
$user->blocked = 1;
$user->blocked_code = 'email_changed';
$this->be($user);
$response = $this->get('/_test/authenticate');
//$this->assertEquals(Response::HTTP_FOUND, $response->getStatusCode());
$this->assertEquals(Response::HTTP_FOUND, $response->getStatusCode());
$response->assertSessionHas('logoutMessage', strval(trans('firefly.email_changed_logout')));
//$response->assertRedirect(route('login'));
$response->assertRedirect(route('login'));
}
/**

View File

@@ -39,7 +39,6 @@ class IsDemoUserTest extends TestCase
*/
public function testMiddlewareAuthenticated()
{
$this->withoutExceptionHandling();
$this->be($this->user());
$response = $this->get('/_test/is-demo');
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
@@ -50,7 +49,6 @@ class IsDemoUserTest extends TestCase
*/
public function testMiddlewareNotAuthenticated()
{
$this->withoutExceptionHandling();
$response = $this->get('/_test/is-demo');
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
}
@@ -62,7 +60,7 @@ class IsDemoUserTest extends TestCase
{
$this->be($this->demoUser());
$response = $this->get('/_test/is-demo');
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
$this->assertEquals(Response::HTTP_FOUND, $response->getStatusCode());
$response->assertSessionHas('info');
}