mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
More tests! Yay!
This commit is contained in:
@@ -52,6 +52,7 @@ class PiggyBankControllerCest
|
||||
$I->wantTo('delete a piggy bank');
|
||||
$I->amOnPage('/piggy_banks/delete/1');
|
||||
$I->see('Delete "New camera"');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,6 +65,7 @@ class PiggyBankControllerCest
|
||||
$I->see('Delete "New camera"');
|
||||
$I->submitForm('#destroy', []);
|
||||
$I->see('Piggy bank "New camera" deleted.');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,13 +244,13 @@ class PiggyBankControllerCest
|
||||
$I->see('Edit piggy bank "New camera"');
|
||||
$I->submitForm(
|
||||
'#update', [
|
||||
'name' => 'Updated camera',
|
||||
'account_id' => 2,
|
||||
'targetamount' => 2000,
|
||||
'targetdate' => '',
|
||||
'reminder' => 'week',
|
||||
'post_submit_action' => 'update',
|
||||
]
|
||||
'name' => 'Updated camera',
|
||||
'account_id' => 2,
|
||||
'targetamount' => 2000,
|
||||
'targetdate' => '',
|
||||
'reminder' => 'week',
|
||||
'post_submit_action' => 'update',
|
||||
]
|
||||
);
|
||||
$I->see('Piggy bank "Updated camera" updated.');
|
||||
|
||||
@@ -311,13 +313,13 @@ class PiggyBankControllerCest
|
||||
$I->see('Edit piggy bank "New camera"');
|
||||
$I->submitForm(
|
||||
'#update', [
|
||||
'name' => '',
|
||||
'account_id' => 2,
|
||||
'targetamount' => 2000,
|
||||
'targetdate' => '',
|
||||
'reminder' => 'week',
|
||||
'post_submit_action' => 'update',
|
||||
]
|
||||
'name' => '',
|
||||
'account_id' => 2,
|
||||
'targetamount' => 2000,
|
||||
'targetdate' => '',
|
||||
'reminder' => 'week',
|
||||
'post_submit_action' => 'update',
|
||||
]
|
||||
);
|
||||
$I->see('Name is too short');
|
||||
$I->seeInDatabase('piggy_banks', ['name' => 'New camera']);
|
||||
|
123
tests/functional/RecurringControllerCest.php
Normal file
123
tests/functional/RecurringControllerCest.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Class RecurringControllerCest
|
||||
*/
|
||||
class RecurringControllerCest
|
||||
{
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function _after(FunctionalTester $I)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function _before(FunctionalTester $I)
|
||||
{
|
||||
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function create(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('create a recurring transaction');
|
||||
$I->amOnPage('/recurring/create');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function delete(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('delete a recurring transaction');
|
||||
$I->amOnPage('/recurring/delete/1');
|
||||
$I->see('Delete "Huur"');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function destroy(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('destroy a recurring transaction');
|
||||
$I->amOnPage('/recurring/delete/1');
|
||||
$I->see('Delete "Huur"');
|
||||
$I->submitForm('#destroy', []);
|
||||
$I->see('The recurring transaction was deleted.');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function edit(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('edit a recurring transaction');
|
||||
$I->amOnPage('/recurring/edit/1');
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function index(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('see all recurring transactions');
|
||||
$I->amOnPage('/recurring');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function rescan(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('rescan a recurring transaction');
|
||||
$I->amOnPage('/recurring/rescan/1');
|
||||
$I->see('Rescanned everything.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function rescanInactive(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('rescan an inactive recurring transaction');
|
||||
$I->amOnPage('/recurring/rescan/2');
|
||||
$I->see('Inactive recurring transactions cannot be scanned.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function show(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('show a recurring transaction');
|
||||
$I->amOnPage('/recurring/show/1');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function store(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('store a recurring transaction');
|
||||
$I->amOnPage('/recurring/create');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function update(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a recurring transaction');
|
||||
$I->amOnPage('/recurring/edit/1');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user