mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Expanded some tests.
This commit is contained in:
parent
59d2bf3f79
commit
f24cfe39aa
@ -1,2 +0,0 @@
|
|||||||
- replace \Session with Session
|
|
||||||
- find all event::fire's, and see if they fire in new ff as well.
|
|
@ -64,7 +64,7 @@ class ReminderControllerTest extends TestCase
|
|||||||
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
$collection = new Collection([$reminder]);
|
$collection = new Collection([$reminder]);
|
||||||
|
|
||||||
$repository = $this->mock('FireflyIII\Repositories\Reminder\ReminderRepositoryInterface\ReminderRepositoryInterface');
|
$repository = $this->mock('FireflyIII\Repositories\Reminder\ReminderRepositoryInterface');
|
||||||
|
|
||||||
$repository->shouldReceive('getActiveReminders')->andReturn($collection);
|
$repository->shouldReceive('getActiveReminders')->andReturn($collection);
|
||||||
$repository->shouldReceive('getExpiredReminders')->andReturn($collection);
|
$repository->shouldReceive('getExpiredReminders')->andReturn($collection);
|
||||||
|
@ -289,7 +289,52 @@ class TransactionControllerTest extends TestCase
|
|||||||
'account_id' => $account->id,
|
'account_id' => $account->id,
|
||||||
'expense_account' => 'Lunch House',
|
'expense_account' => 'Lunch House',
|
||||||
'amount' => '4.72',
|
'amount' => '4.72',
|
||||||
'amount_currency_id' => '1',
|
'amount_currency_id' => $currency->id,
|
||||||
|
'date' => '2015-05-31',
|
||||||
|
'budget_id' => '0',
|
||||||
|
'category' => 'Lunch',
|
||||||
|
'tags' => '',
|
||||||
|
'piggy_bank_id' => '0',
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->call('POST', '/transactions/store/withdrawal', $data);
|
||||||
|
|
||||||
|
// mock!
|
||||||
|
$repository = $this->mock('FireflyIII\Repositories\Journal\JournalRepositoryInterface');
|
||||||
|
|
||||||
|
// fake!
|
||||||
|
$repository->shouldReceive('update')->andReturn($journal);
|
||||||
|
|
||||||
|
|
||||||
|
$this->call('POST', '/transaction/update/' . $journal->id, $data);
|
||||||
|
//$this->assertSessionHas('errors','bla');
|
||||||
|
$this->assertResponseStatus(302);
|
||||||
|
$this->assertSessionHas('success');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testUpdateWithRedirect()
|
||||||
|
{
|
||||||
|
$account = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$this->be($journal->user);
|
||||||
|
$account->user_id = $journal->user_id;
|
||||||
|
$account->save();
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'_token' => 'replaceMe',
|
||||||
|
'id' => $journal->id,
|
||||||
|
'what' => 'withdrawal',
|
||||||
|
'description' => 'LunchX',
|
||||||
|
'account_id' => $account->id,
|
||||||
|
'expense_account' => 'Lunch House',
|
||||||
|
'amount' => '4.72',
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
'date' => '2015-05-31',
|
'date' => '2015-05-31',
|
||||||
'budget_id' => '0',
|
'budget_id' => '0',
|
||||||
'category' => 'Lunch',
|
'category' => 'Lunch',
|
||||||
|
Loading…
Reference in New Issue
Block a user