This should fix the tests on the translations branch.

This commit is contained in:
James Cole
2015-05-14 18:15:31 +02:00
parent a82b829da9
commit d3897eece7
6 changed files with 68 additions and 0 deletions

View File

@@ -59,6 +59,12 @@ class PreferencesControllerTest extends TestCase
Amount::shouldReceive('getAllCurrencies')->andReturn(new Collection);
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
// language preference:
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
$language->data = 'en';
$language->save();
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
$this->call('GET', '/preferences');
$this->assertResponseOk();
}
@@ -78,6 +84,12 @@ class PreferencesControllerTest extends TestCase
Preferences::shouldReceive('set')->once()->withArgs(['viewRange', '1M']);
Preferences::shouldReceive('set')->once()->withArgs(['budgetMaximum', 0]);
// language preference:
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
$language->data = 'en';
$language->save();
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
$this->call('POST', '/preferences', $data);
$this->assertResponseStatus(302);