mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Some new tests.
This commit is contained in:
@@ -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');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user