Push updated tests.

This commit is contained in:
James Cole
2018-03-28 19:38:20 +02:00
parent be5c44af61
commit 0a71077513
55 changed files with 344 additions and 266 deletions

View File

@@ -30,6 +30,7 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use Illuminate\Support\Collection;
use Log;
use Tests\TestCase;
use Mockery;
/**
* Class JavascriptControllerTest
@@ -62,6 +63,7 @@ class JavascriptControllerTest extends TestCase
$accountRepos->shouldReceive('getAccountsByType')->andReturn(new Collection([$account]))
->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->once();
$currencyRepos->shouldReceive('findByCodeNull')->withArgs(['EUR'])->andReturn(new TransactionCurrency);
$accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'currency_id'])->andReturn('1');
$this->be($this->user());
$response = $this->get(route('javascript.accounts'));
@@ -77,6 +79,8 @@ class JavascriptControllerTest extends TestCase
$currency = factory(TransactionCurrency::class)->make();
$repository->shouldReceive('get')->andReturn(new Collection([$currency]));
$this->be($this->user());
$response = $this->get(route('javascript.currencies'));
$response->assertStatus(200);
@@ -96,6 +100,7 @@ class JavascriptControllerTest extends TestCase
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
$accountRepos->shouldReceive('findNull')->andReturn(new Account);
$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));
$accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'currency_id'])->andReturn('1');
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('javascript.variables'));
@@ -116,6 +121,7 @@ class JavascriptControllerTest extends TestCase
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
$accountRepos->shouldReceive('findNull')->andReturn(new Account);
$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));
$accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(),'currency_id'])->andReturn('1');
$this->be($this->user());
$this->changeDateRange($this->user(), $range);