Some new tests.

This commit is contained in:
James Cole
2015-03-28 06:19:09 +01:00
parent b9000519e4
commit bcf7452312
4 changed files with 91 additions and 28 deletions

View File

@@ -26,31 +26,38 @@ class HomeControllerTest extends TestCase
parent::tearDown();
}
/**
* @covers FireflyIII\Http\Controllers\HomeController::dateRange
*/
public function testDateRangeWarning()
{
$start = '2014-03-01';
$end = '2015-03-31';
$this->be(new FireflyIII\User);
$this->call('POST', '/daterange', ['end' => $end, 'start' => $start]);
$this->assertResponseOk();
$this->assertSessionHas('start');
$this->assertSessionHas('end');
$this->assertSessionHas('warning');
}
/**
* @covers FireflyIII\Http\Controllers\HomeController::dateRange
*/
public function testDateRange()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}
$start = '2015-03-01';
$end = '2015-03-31';
/**
* @covers FireflyIII\Http\Controllers\HomeController::flush
*/
public function testFlush()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete('This test has not been implemented yet.');
}
$this->be(new FireflyIII\User);
$this->call('POST', '/daterange', ['end' => $end, 'start' => $start]);
$this->assertResponseOk();
/**
* @covers FireflyIII\Http\Controllers\HomeController::index
*/
public function testIndexNoLogin()
{
$response = $this->call('GET', '/');
$this->assertRedirectedTo('auth/login');
$this->assertSessionHas('start');
$this->assertSessionHas('end');
}
@@ -65,4 +72,14 @@ class HomeControllerTest extends TestCase
}
/**
* @covers FireflyIII\Http\Controllers\HomeController::index
*/
public function testIndexNoLogin()
{
$response = $this->call('GET', '/');
$this->assertRedirectedTo('auth/login');
}
}