Some new code + GA

This commit is contained in:
James Cole
2015-03-31 19:21:49 +02:00
parent f8a5fb4225
commit e11e53913a
13 changed files with 84 additions and 28 deletions

View File

@@ -1,5 +1,4 @@
<?php
/**
* Class TestCase
*/
@@ -20,4 +19,18 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
return $app;
}
/**
* @param string $class
*
* @return mixed
*/
public function mock($class)
{
$mock = Mockery::mock($class);
$this->app->instance($class, $mock);
return $mock;
}
}

View File

@@ -1,4 +1,5 @@
<?php
use FireflyIII\Models\Preference;
/**
* Generated by PHPUnit_SkeletonGenerator on 2015-03-08 at 20:05:14.
@@ -30,8 +31,17 @@ class AccountControllerTest extends TestCase
public function testCreate()
{
$this->be(new FireflyIII\User);
$pref = new Preference;
$pref->data = '1M';
Preferences::shouldReceive('get', 'viewRange')->andReturn($pref);
Amount::shouldReceive('getDefaultCurrency')->andReturn(null);
$response = $this->call('GET', '/accounts/create/asset');
$this->assertResponseOk();
$this->assertViewHas('subTitle', 'Create a new asset account');
$this->assertViewHas('subTitleIcon', 'fa-money');
$this->assertViewHas('what', 'asset');