Some refactoring.

This commit is contained in:
James Cole
2014-12-30 18:44:58 +01:00
parent 94fcfacec4
commit 8c3ae40de1
26 changed files with 327 additions and 329 deletions

View File

@@ -68,6 +68,19 @@ class AccountControllerCest
$I->see('Edit asset account "Delete me"');
}
/**
* @param FunctionalTester $I
*/
public function failUpdate(FunctionalTester $I)
{
$I->wantTo('update an asset account and fail');
$I->amOnPage('/accounts/edit/3');
$I->see('Edit asset account "Delete me"');
$I->submitForm('#update', ['name' => '', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'update']);
$I->seeRecord('accounts', ['name' => 'Delete me']);
}
/**
* @param FunctionalTester $I
*/
@@ -103,21 +116,6 @@ class AccountControllerCest
resetToClean::clean();
}
/**
* @param FunctionalTester $I
*/
public function storeValidateOnly(FunctionalTester $I)
{
$I->amOnPage('/accounts/create/asset');
$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']
);
$I->dontSeeRecord('accounts', ['name' => 'New through tests.']);
resetToClean::clean();
}
/**
* @param FunctionalTester $I
*/
@@ -146,6 +144,21 @@ class AccountControllerCest
resetToClean::clean();
}
/**
* @param FunctionalTester $I
*/
public function storeValidateOnly(FunctionalTester $I)
{
$I->amOnPage('/accounts/create/asset');
$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']
);
$I->dontSeeRecord('accounts', ['name' => 'New through tests.']);
resetToClean::clean();
}
/**
* @param FunctionalTester $I
*/
@@ -160,34 +173,6 @@ class AccountControllerCest
}
/**
* @param FunctionalTester $I
*/
public function failUpdate(FunctionalTester $I)
{
$I->wantTo('update an asset account and fail');
$I->amOnPage('/accounts/edit/3');
$I->see('Edit asset account "Delete me"');
$I->submitForm('#update', ['name' => '', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'update']);
$I->seeRecord('accounts', ['name' => 'Delete me']);
}
/**
* @param FunctionalTester $I
*/
public function validateUpdateOnly(FunctionalTester $I)
{
$I->wantTo('update an asset account and validate only');
$I->amOnPage('/accounts/edit/2');
$I->see('Edit asset account "Savings account"');
$I->submitForm(
'#update', ['name' => 'Savings accountXX', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
);
$I->dontSeeRecord('accounts', ['name' => 'Savings accountXX']);
}
/**
* @param FunctionalTester $I
*/
@@ -204,4 +189,19 @@ class AccountControllerCest
}
/**
* @param FunctionalTester $I
*/
public function validateUpdateOnly(FunctionalTester $I)
{
$I->wantTo('update an asset account and validate only');
$I->amOnPage('/accounts/edit/2');
$I->see('Edit asset account "Savings account"');
$I->submitForm(
'#update', ['name' => 'Savings accountXX', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
);
$I->dontSeeRecord('accounts', ['name' => 'Savings accountXX']);
}
}