Improve test coverage.

This commit is contained in:
James Cole
2017-06-28 18:05:38 +02:00
parent 67fc810fc2
commit a4ef81ebd8
4 changed files with 193 additions and 7 deletions

View File

@@ -122,10 +122,13 @@ class MassControllerTest extends TestCase
->orderBy('ct', 'DESC')
->where('user_id', $this->user()->id)->first(['transaction_journals.id', DB::raw('count(transactions.`id`) as ct')])
);
$allIds = $collection->pluck('id')->toArray();
// add opening balance:
$collection->push(TransactionJournal::where('transaction_type_id', 4)->where('user_id', $this->user()->id)->first());
$allIds = $collection->pluck('id')->toArray();
$route = route('transactions.mass.edit', join(',', $allIds));
$this->be($this->user());
$response = $this->get(route('transactions.mass.edit', join(',', $allIds)));
$response = $this->get($route);
$response->assertStatus(200);
$response->assertSee('Edit a number of transactions');
// has bread crumb