Code cleanup

This commit is contained in:
James Cole
2015-05-17 11:28:58 +02:00
parent 6280448dfb
commit 033f5b67db
18 changed files with 96 additions and 51 deletions

View File

@@ -40,8 +40,8 @@ class JsonControllerTest extends TestCase
public function testBoxBillsPaid()
{
$bill = FactoryMuffin::create('FireflyIII\Models\Bill');
$cc = FactoryMuffin::create('FireflyIII\Models\Account');
$ccs = new Collection([$cc]);
$creditCard = FactoryMuffin::create('FireflyIII\Models\Account');
$ccs = new Collection([$creditCard]);
$collection = new Collection([$bill]);
$ranges = [['start' => new Carbon, 'end' => new Carbon]];
$this->be($bill->user);
@@ -69,8 +69,8 @@ class JsonControllerTest extends TestCase
public function testBoxBillsUnpaid()
{
$bill = FactoryMuffin::create('FireflyIII\Models\Bill');
$cc = FactoryMuffin::create('FireflyIII\Models\Account');
$ccs = new Collection([$cc]);
$creditCard = FactoryMuffin::create('FireflyIII\Models\Account');
$ccs = new Collection([$creditCard]);
$collection = new Collection([$bill]);
$ranges = [['start' => new Carbon, 'end' => new Carbon]];
$this->be($bill->user);
@@ -133,24 +133,6 @@ class JsonControllerTest extends TestCase
$this->assertResponseOk();
}
public function testTags()
{
$user = FactoryMuffin::create('FireflyIII\User');
$this->be($user);
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
$tag->user()->associate($user);
$tag->save();
$this->be($tag->user);
$tags = new Collection([$tag]);
$repository = $this->mock('FireflyIII\Repositories\Tag\TagRepositoryInterface');
$repository->shouldReceive('get')->andReturn($tags);
$this->call('GET', '/json/tags');
$this->assertResponseOk();
}
public function testExpenseAccounts()
{
$account = FactoryMuffin::create('FireflyIII\Models\Account');
@@ -177,6 +159,24 @@ class JsonControllerTest extends TestCase
$this->assertResponseOk();
}
public function testTags()
{
$user = FactoryMuffin::create('FireflyIII\User');
$this->be($user);
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
$tag->user()->associate($user);
$tag->save();
$this->be($tag->user);
$tags = new Collection([$tag]);
$repository = $this->mock('FireflyIII\Repositories\Tag\TagRepositoryInterface');
$repository->shouldReceive('get')->andReturn($tags);
$this->call('GET', '/json/tags');
$this->assertResponseOk();
}
public function testTransactionJournals()
{
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');