mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
Code cleanup for #595
This commit is contained in:
@@ -71,6 +71,24 @@ class AttachmentControllerTest extends TestCase
|
||||
$response->assertSee('This is attachment number one.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\AttachmentController::download
|
||||
* @expectedExceptionMessage Could not find the indicated attachment
|
||||
*/
|
||||
public function testDownloadFail()
|
||||
{
|
||||
// mock stuff
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$repository = $this->mock(AttachmentRepositoryInterface::class);
|
||||
$repository->shouldReceive('exists')->once()->andReturn(false);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('attachments.download', [1]));
|
||||
$response->assertStatus(500);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\AttachmentController::edit
|
||||
*/
|
||||
@@ -94,7 +112,7 @@ class AttachmentControllerTest extends TestCase
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('attachments.preview', [1]));
|
||||
$response = $this->get(route('attachments.preview', [3]));
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user