Move code around for simplicity and fix tests.

This commit is contained in:
James Cole
2017-06-07 11:13:04 +02:00
parent 92c5cabd70
commit 8bbd3063ec
14 changed files with 271 additions and 251 deletions

View File

@@ -444,14 +444,16 @@ class BudgetControllerTest extends TestCase
*/
public function testUpdateIncome()
{
// must be in list
$this->be($this->user());
// mock stuff
$repository = $this->mock(BudgetRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('getAvailableBudget')->andReturn('1');
$repository->shouldReceive('cleanupBudgets');
// must be in list
$this->be($this->user());
$response = $this->get(route('budgets.income', [1]));
$response->assertStatus(200);
}