Improve test coverage.

This commit is contained in:
James Cole
2018-03-03 17:16:47 +01:00
parent 9dc4c50527
commit 7542175258
28 changed files with 414 additions and 98 deletions

View File

@@ -35,7 +35,7 @@ use Tests\TestCase;
class IsDemoUserTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Middleware\IsDemoUser::handle
* @covers \FireflyIII\Http\Middleware\IsDemoUser
*/
public function testMiddlewareAuthenticated()
{
@@ -45,9 +45,8 @@ class IsDemoUserTest extends TestCase
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
}
/**
* @covers \FireflyIII\Http\Middleware\IsDemoUser::handle
* @covers \FireflyIII\Http\Middleware\IsDemoUser
*/
public function testMiddlewareNotAuthenticated()
{
@@ -56,6 +55,17 @@ class IsDemoUserTest extends TestCase
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
}
/**
* @covers \FireflyIII\Http\Middleware\IsDemoUser
*/
public function testMiddlewareIsDemoUser()
{
$this->be($this->demoUser());
$response = $this->get('/_test/is-demo');
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
$response->assertSessionHas('info');
}
/**
* Set up test
*/