Fix unit tests

This commit is contained in:
James Cole
2018-01-25 20:38:50 +01:00
parent 3fa39a6805
commit f50550d79c
11 changed files with 24 additions and 51 deletions

View File

@@ -123,12 +123,16 @@ class AttachmentControllerTest extends TestCase
* @covers \FireflyIII\Http\Controllers\AttachmentController::preview
* @covers \FireflyIII\Http\Controllers\AttachmentController::__construct
*/
public function testPreview()
public function testView()
{
$repository = $this->mock(AttachmentRepositoryInterface::class);
$repository->shouldReceive('exists')->once()->andReturn(true);
$repository->shouldReceive('getContent')->once()->andReturn('This is attachment number one.');
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$response = $this->get(route('attachments.preview', [3]));
$response = $this->get(route('attachments.view', [3]));
$response->assertStatus(200);
}