Fixed tests.

This commit is contained in:
James Cole
2015-03-31 17:49:47 +02:00
parent 3a49450461
commit f8a5fb4225
8 changed files with 207 additions and 47 deletions

View File

@@ -13,7 +13,6 @@ class AccountControllerTest extends TestCase
public function setUp()
{
parent::setUp();
$this->be(FireflyIII\User::whereEmail('thegrumpydictator@gmail.com')->first());
}
@@ -30,6 +29,7 @@ class AccountControllerTest extends TestCase
public function testCreate()
{
$this->be(new FireflyIII\User);
$response = $this->call('GET', '/accounts/create/asset');
$this->assertResponseOk();
$this->assertViewHas('subTitle', 'Create a new asset account');

View File

@@ -13,8 +13,7 @@ class HomeControllerTest extends TestCase
public function setUp()
{
parent::setUp();
Artisan::call('migrate');
}
/**
@@ -33,8 +32,7 @@ class HomeControllerTest extends TestCase
{
$start = '2014-03-01';
$end = '2015-03-31';
$this->be(FireflyIII\User::whereEmail('thegrumpydictator@gmail.com')->first());
$this->be(new FireflyIII\User);
$this->call('POST', '/daterange', ['end' => $end, 'start' => $start,'_token' => 'replaceme']);
$this->assertResponseOk();
@@ -51,8 +49,9 @@ class HomeControllerTest extends TestCase
{
$start = '2015-03-01';
$end = '2015-03-31';
$this->be(new FireflyIII\User);
$this->be(FireflyIII\User::whereEmail('thegrumpydictator@gmail.com')->first());
$this->call('POST', '/daterange', ['end' => $end, 'start' => $start,'_token' => 'replaceme']);
$this->assertResponseOk();
@@ -66,7 +65,9 @@ class HomeControllerTest extends TestCase
*/
public function testIndexLoggedIn()
{
$this->be(FireflyIII\User::whereEmail('thegrumpydictator@gmail.com')->first());
$this->be(new FireflyIII\User);
Amount::shouldReceive('getCurrencyCode')->andReturn('EUR');
$response = $this->call('GET', '/');
$this->assertResponseOk();