mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-03 12:47:17 -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');
|
||||
$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('getExpiredReminders')->andReturn($collection);
|
||||
|
@ -289,11 +289,56 @@ class TransactionControllerTest extends TestCase
|
||||
'account_id' => $account->id,
|
||||
'expense_account' => 'Lunch House',
|
||||
'amount' => '4.72',
|
||||
'amount_currency_id' => '1',
|
||||
'amount_currency_id' => $currency->id,
|
||||
'date' => '2015-05-31',
|
||||
'budget_id' => '0',
|
||||
'category' => 'Lunch',
|
||||
'return_to_edit' => 1,
|
||||
'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',
|
||||
'budget_id' => '0',
|
||||
'category' => 'Lunch',
|
||||
'return_to_edit' => 1,
|
||||
'tags' => '',
|
||||
'piggy_bank_id' => '0',
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user