mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 16:13:54 +00:00
Expand exception code and fix demo user redirect.
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user