mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
More tests!
This commit is contained in:
@@ -109,7 +109,7 @@ class AccountControllerCest
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/accounts/create/asset');
|
||||
$I->wantTo('store a new asset account');
|
||||
$I->wantTo('validate a new asset account');
|
||||
$I->see('Create a new asset account');
|
||||
$I->submitForm(
|
||||
'#store', ['name' => 'New through tests.', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
|
||||
|
@@ -129,15 +129,108 @@ class BudgetControllerCest
|
||||
*/
|
||||
public function store(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('store a budget');
|
||||
$I->amOnPage('/budgets/create');
|
||||
$I->wantTo('store a new budget');
|
||||
$I->see('Create a new budget');
|
||||
$I->submitForm('#store', ['name' => 'New budget.', 'post_submit_action' => 'store']);
|
||||
$I->seeRecord('budgets', ['name' => 'New budget.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/budgets/create');
|
||||
$I->wantTo('validate a new budget');
|
||||
$I->see('Create a new budget');
|
||||
$I->submitForm('#store', ['name' => 'New budget.', 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('budgets', ['name' => 'New budget.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeAndCreateAnother(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/budgets/create');
|
||||
$I->wantTo('store a new budget and create another');
|
||||
$I->see('Create a new budget');
|
||||
$I->submitForm('#store', ['name' => 'New budget.', 'post_submit_action' => 'create_another']);
|
||||
$I->seeRecord('budgets', ['name' => 'New budget.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeFail(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/budgets/create');
|
||||
$I->wantTo('make storing a new budget fail.');
|
||||
$I->see('Create a new budget');
|
||||
$I->submitForm('#store', ['name' => null, 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('budgets', ['name' => 'New budget.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function update(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a budget');
|
||||
$I->amOnPage('/budgets/edit/3');
|
||||
$I->see('Edit budget "Delete me"');
|
||||
$I->submitForm('#update', ['name' => 'Update me', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('budgets', ['name' => 'Update me']);
|
||||
resetToClean::clean();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a budget and fail');
|
||||
$I->amOnPage('/budgets/edit/3');
|
||||
$I->see('Edit budget "Delete me"');
|
||||
$I->submitForm('#update', ['name' => '', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('budgets', ['name' => 'Delete me']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function validateUpdateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a budget and validate only');
|
||||
$I->amOnPage('/budgets/edit/3');
|
||||
$I->see('Edit budget "Delete me"');
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Validate Only', 'post_submit_action' => 'validate_only']
|
||||
);
|
||||
$I->dontSeeRecord('budgets', ['name' => 'Savings accountXX']);
|
||||
$I->seeRecord('budgets', ['name' => 'Delete me']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateAndReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a budget and return to form');
|
||||
$I->amOnPage('/budgets/edit/3');
|
||||
$I->see('Edit budget "Delete me"');
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Savings accountXX', 'post_submit_action' => 'return_to_edit']
|
||||
);
|
||||
$I->seeRecord('budgets', ['name' => 'Savings accountXX']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,6 +238,8 @@ class BudgetControllerCest
|
||||
*/
|
||||
public function updateIncome(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/budgets/income');
|
||||
$I->wantTo('update my monthly income');
|
||||
$I->see('Update (expected) income for ');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user