mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 09:51:21 -06:00
Fixed JSON controller tests.
This commit is contained in:
parent
06c6d6096f
commit
26079622f9
@ -132,6 +132,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 testExpenseAccounts()
|
||||
{
|
||||
$account = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
|
@ -66,6 +66,21 @@ FactoryMuffin::define(
|
||||
]
|
||||
);
|
||||
|
||||
FactoryMuffin::define(
|
||||
'FireflyIII\Models\Tag',
|
||||
[
|
||||
'description' => 'sentence',
|
||||
'user_id' => 'factory|FireflyIII\User',
|
||||
'tag' => function () {
|
||||
return RandomString::generateRandomString(20);
|
||||
},
|
||||
'tagMode' => 'nothing',
|
||||
'date' => 'date',
|
||||
'latitude' => 12,
|
||||
'longitude' => 13,
|
||||
]
|
||||
);
|
||||
|
||||
FactoryMuffin::define(
|
||||
'FireflyIII\Models\Budget',
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user