Mock previously unmocked calls.

This commit is contained in:
James Cole
2015-04-07 18:48:34 +02:00
parent 0d336727e8
commit f10f5d30bf
7 changed files with 69 additions and 23 deletions

View File

@@ -78,12 +78,13 @@ class BudgetControllerTest extends TestCase
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
$this->be($budget->user);
$this->assertCount(1, DB::table('budgets')->where('id', $budget->id)->get());
$repository = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
$repository->shouldReceive('destroy')->andReturn(true);
$this->call('POST', '/budgets/destroy/' . $budget->id, ['_token' => 'replaceme']);
$this->assertSessionHas('success', 'The budget "' . e($budget->name) . '" was deleted.');
$this->assertCount(0, DB::table('budgets')->wherenull('deleted_at')->where('id', $budget->id)->get());
}
public function testEdit()