Updated all tests to include the range.

This commit is contained in:
James Cole 2016-02-05 06:45:54 +01:00
parent 45deb493ba
commit 581e2ad431
8 changed files with 30 additions and 4 deletions

View File

@ -64,6 +64,7 @@ class BillControllerTest extends TestCase
public function testIndex($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/bills');
$this->assertResponseStatus(200);
}
@ -75,6 +76,7 @@ class BillControllerTest extends TestCase
public function testRescan($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/bills/rescan/1');
$this->assertSessionHas('success');
$this->assertResponseStatus(302);
@ -87,6 +89,7 @@ class BillControllerTest extends TestCase
public function testShow($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/bills/show/1');
$this->assertResponseStatus(200);
}

View File

@ -24,6 +24,7 @@ class BudgetControllerTest extends TestCase
'amount' => 1200,
];
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('POST', '/budgets/amount/1', $args);
$this->assertResponseStatus(200);
@ -79,6 +80,7 @@ class BudgetControllerTest extends TestCase
public function testIndex($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/budgets');
$this->assertResponseStatus(200);
}
@ -90,6 +92,7 @@ class BudgetControllerTest extends TestCase
public function testNoBudget($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/budgets/list/noBudget');
$this->assertResponseStatus(200);
}
@ -104,6 +107,7 @@ class BudgetControllerTest extends TestCase
'amount' => 1200,
];
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('POST', '/budgets/income', $args);
$this->assertResponseStatus(302);
@ -116,6 +120,7 @@ class BudgetControllerTest extends TestCase
public function testShow($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/budgets/show/1');
$this->assertResponseStatus(200);
}
@ -164,6 +169,7 @@ class BudgetControllerTest extends TestCase
public function testUpdateIncome($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/budgets/income');
$this->assertResponseStatus(200);
}

View File

@ -78,6 +78,7 @@ class CurrencyControllerTest extends TestCase
public function testIndex($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/currency');
$this->assertResponseStatus(200);
}

View File

@ -47,6 +47,7 @@ class HomeControllerTest extends TestCase
public function testIndex($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/');
$this->assertResponseStatus(200);
}

View File

@ -33,6 +33,7 @@ class JsonControllerTest extends TestCase
public function testBoxBillsPaid($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/json/box/bills-paid');
$this->assertResponseStatus(200);
}
@ -44,6 +45,7 @@ class JsonControllerTest extends TestCase
public function testBoxBillsUnpaid($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/json/box/bills-unpaid');
$this->assertResponseStatus(200);
}
@ -55,6 +57,7 @@ class JsonControllerTest extends TestCase
public function testBoxIn($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/json/box/in');
$this->assertResponseStatus(200);
}
@ -66,6 +69,7 @@ class JsonControllerTest extends TestCase
public function testBoxOut($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/json/box/out');
$this->assertResponseStatus(200);
}
@ -77,6 +81,7 @@ class JsonControllerTest extends TestCase
public function testCategories($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/json/categories');
$this->assertResponseStatus(200);
}
@ -145,6 +150,7 @@ class JsonControllerTest extends TestCase
$repository->shouldReceive('getJournalsOfType')->with($type)->once()->andReturn(new Collection);
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/json/transaction-journals/deposit');
$this->assertResponseStatus(200);
}

View File

@ -14,13 +14,14 @@
class PiggyBankControllerTest extends TestCase
{
/**
* @covers FireflyIII\Http\Controllers\PiggyBankController::add
* @covers FireflyIII\Http\Controllers\PiggyBankController::__construct
* @covers FireflyIII\Http\Controllers\PiggyBankController::add
* @covers FireflyIII\Http\Controllers\PiggyBankController::__construct
* @dataProvider dateRangeProvider
*/
public function testAdd($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/piggy-banks/add/1');
$this->assertResponseStatus(200);
}
@ -68,12 +69,13 @@ class PiggyBankControllerTest extends TestCase
}
/**
* @covers FireflyIII\Http\Controllers\PiggyBankController::index
* @covers FireflyIII\Http\Controllers\PiggyBankController::index
* @dataProvider dateRangeProvider
*/
public function testIndex($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/piggy-banks');
$this->assertResponseStatus(200);
}
@ -134,12 +136,13 @@ class PiggyBankControllerTest extends TestCase
}
/**
* @covers FireflyIII\Http\Controllers\PiggyBankController::show
* @covers FireflyIII\Http\Controllers\PiggyBankController::show
* @dataProvider dateRangeProvider
*/
public function testShow($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/piggy-banks/show/1');
$this->assertResponseStatus(200);
}

View File

@ -25,6 +25,7 @@ class ReportControllerTest extends TestCase
public function testIndex($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/reports');
$this->assertResponseStatus(200);
@ -47,6 +48,7 @@ class ReportControllerTest extends TestCase
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/reports/report/default/20160101/20160131/1,2');
$this->assertResponseStatus(200);
}
@ -59,6 +61,7 @@ class ReportControllerTest extends TestCase
public function testReportDefaultYear($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/reports/report/default/20160101/20161231/1,2');
$this->assertResponseStatus(200);
}
@ -71,6 +74,7 @@ class ReportControllerTest extends TestCase
public function testReportDefaultMultiYear($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/reports/report/default/20160101/20171231/1,2');
$this->assertResponseStatus(200);
}

View File

@ -65,6 +65,7 @@ class TransactionControllerTest extends TestCase
public function testIndex($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/transactions/deposit');
$this->assertResponseStatus(200);
}
@ -90,6 +91,7 @@ class TransactionControllerTest extends TestCase
public function testShow($range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$this->call('GET', '/transaction/show/1');
$this->assertResponseStatus(200);
}