mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code and tests for #1450
This commit is contained in:
@@ -78,6 +78,25 @@ class AutoCompleteControllerTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Json\AutoCompleteController
|
||||
*/
|
||||
public function testAssetAccounts(): void
|
||||
{
|
||||
// mock stuff
|
||||
$accountA = factory(Account::class)->make();
|
||||
$collection = new Collection([$accountA]);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$accountRepos->shouldReceive('getAccountsByType')
|
||||
->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->andReturn($collection);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('json.asset-accounts'));
|
||||
$response->assertStatus(200);
|
||||
$response->assertExactJson([$accountA->name]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Json\AutoCompleteController
|
||||
*/
|
||||
|
Reference in New Issue
Block a user