Improve test coverage.

This commit is contained in:
James Cole
2017-03-18 20:53:44 +01:00
parent 00b1b54347
commit 1adb0f2f0e
18 changed files with 136 additions and 49 deletions

View File

@@ -106,7 +106,7 @@ class PiggyBankControllerTest extends TestCase
$repository->shouldReceive('destroy')->andReturn(true);
$this->session(['piggy-banks.delete.url' => 'http://localhost']);
$this->session(['piggy-banks.delete.uri' => 'http://localhost']);
$this->be($this->user());
$response = $this->post(route('piggy-banks.destroy', [2]));
$response->assertStatus(302);
@@ -294,7 +294,7 @@ class PiggyBankControllerTest extends TestCase
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('store')->andReturn(new PiggyBank);
$this->session(['piggy-banks.create.url' => 'http://localhost']);
$this->session(['piggy-banks.create.uri' => 'http://localhost']);
$data = [
'name' => 'Piggy ' . rand(999, 10000),
'targetamount' => '100.123',
@@ -320,7 +320,7 @@ class PiggyBankControllerTest extends TestCase
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('update')->andReturn(new PiggyBank);
$this->session(['piggy-banks.edit.url' => 'http://localhost']);
$this->session(['piggy-banks.edit.uri' => 'http://localhost']);
$data = [
'name' => 'Updated Piggy ' . rand(999, 10000),
'targetamount' => '100.123',