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

@@ -93,7 +93,7 @@ class SingleControllerTest extends TestCase
$repository->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('delete')->once();
$this->session(['transactions.delete.url' => 'http://localhost']);
$this->session(['transactions.delete.uri' => 'http://localhost']);
$this->be($this->user());
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->whereNull('deleted_at')->where('user_id', $this->user()->id)->first();
$response = $this->post(route('transactions.destroy', [$withdrawal->id]));
@@ -198,7 +198,7 @@ class SingleControllerTest extends TestCase
$journal->description = 'New journal';
$repository->shouldReceive('store')->andReturn($journal);
$repository->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->session(['transactions.create.url' => 'http://localhost']);
$this->session(['transactions.create.uri' => 'http://localhost']);
$this->be($this->user());
$data = [
@@ -242,7 +242,7 @@ class SingleControllerTest extends TestCase
$attachmentRepo->shouldReceive('getMessages')->andReturn($messages);
$this->session(['transactions.create.url' => 'http://localhost']);
$this->session(['transactions.create.uri' => 'http://localhost']);
$this->be($this->user());
$data = [
@@ -281,7 +281,7 @@ class SingleControllerTest extends TestCase
$repository->shouldReceive('update')->andReturn($journal);
$repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);
$this->session(['transactions.edit.url' => 'http://localhost']);
$this->session(['transactions.edit.uri' => 'http://localhost']);
$this->be($this->user());
$data = [
'id' => 123,