Tests now run without a database, as they should.

This commit is contained in:
James Cole 2015-04-03 07:33:18 +02:00
parent 36ec974284
commit 720926c50d
3 changed files with 14 additions and 4 deletions

View File

@ -6,6 +6,7 @@ use Cache;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Support\Collection;
use Preferences as Prefs;
/**
@ -134,6 +135,14 @@ class Amount
return $this->formatWithSymbol($symbol, $amount, $coloured);
}
/**
* @return Collection
*/
public function getAllCurrencies()
{
return TransactionCurrency::orderBy('code', 'ASC')->get();
}
/**
* @return string
*/

View File

@ -34,7 +34,7 @@ class ExpandedForm
$options['step'] = 'any';
$options['min'] = '0.01';
$defaultCurrency = isset($options['currency']) ? $options['currency'] : Amt::getDefaultCurrency();
$currencies = TransactionCurrency::orderBy('code', 'ASC')->get();
$currencies = Amt::getAllCurrencies();
$html = View::make('form.amount', compact('defaultCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render();
return $html;
@ -63,7 +63,7 @@ class ExpandedForm
'budget_id' => 'Budget',
'openingBalance' => 'Opening balance',
'virtualBalance' => 'Virtual balance',
'targetamount' => 'Target amount',
'targetamount' => 'Target amount',
'accountRole' => 'Account role',
'openingBalanceDate' => 'Opening balance date',
'piggy_bank_id' => 'Piggy bank'];
@ -145,7 +145,7 @@ class ExpandedForm
$value = $this->fillFieldValue($name, $value);
$options['step'] = 'any';
$defaultCurrency = isset($options['currency']) ? $options['currency'] : Amt::getDefaultCurrency();
$currencies = TransactionCurrency::orderBy('code', 'ASC')->get();
$currencies = Amt::getAllCurrencies();
$html = View::make('form.balance', compact('defaultCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render();
return $html;

View File

@ -14,7 +14,6 @@ class AccountControllerTest extends TestCase
public function setUp()
{
parent::setUp();
Artisan::call('migrate');
}
@ -42,6 +41,8 @@ class AccountControllerTest extends TestCase
Preferences::shouldReceive('get', 'viewRange')->andReturn($pref);
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
// get all currencires?
$response = $this->call('GET', '/accounts/create/asset');
$this->assertResponseOk();