mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-03 20:14:31 +00:00
Some refactoring.
This commit is contained in:
@@ -65,6 +65,19 @@ class CategoryControllerCest
|
||||
$I->see('Edit category "Delete me"');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a category and fail');
|
||||
$I->amOnPage('/categories/edit/4');
|
||||
$I->see('Edit category "Delete me"');
|
||||
$I->submitForm('#update', ['name' => '', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('categories', ['name' => 'Delete me']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -97,19 +110,6 @@ class CategoryControllerCest
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/categories/create');
|
||||
$I->wantTo('validate a new category');
|
||||
$I->see('Create a new category');
|
||||
$I->submitForm('#store', ['name' => 'New category.', 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('categories', ['name' => 'New category.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -131,10 +131,24 @@ class CategoryControllerCest
|
||||
$I->amOnPage('/categories/create');
|
||||
$I->wantTo('make storing a new category fail.');
|
||||
$I->see('Create a new category');
|
||||
$I->submitForm('#store', ['name' => null, 'post_submit_action' => 'validate_only']);
|
||||
$I->submitForm('#store', ['name' => null, 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('categories', ['name' => 'New category.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/categories/create');
|
||||
$I->wantTo('validate a new category');
|
||||
$I->see('Create a new category');
|
||||
$I->submitForm('#store', ['name' => 'New category.', 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('categories', ['name' => 'New category.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -152,13 +166,15 @@ class CategoryControllerCest
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
public function updateAndReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a category and fail');
|
||||
$I->wantTo('update a category and return to form');
|
||||
$I->amOnPage('/categories/edit/4');
|
||||
$I->see('Edit category "Delete me"');
|
||||
$I->submitForm('#update', ['name' => '', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('categories', ['name' => 'Delete me']);
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Savings accountXX', 'post_submit_action' => 'return_to_edit']
|
||||
);
|
||||
$I->seeRecord('categories', ['name' => 'Savings accountXX']);
|
||||
|
||||
}
|
||||
|
||||
@@ -178,19 +194,4 @@ class CategoryControllerCest
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateAndReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a category and return to form');
|
||||
$I->amOnPage('/categories/edit/4');
|
||||
$I->see('Edit category "Delete me"');
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Savings accountXX', 'post_submit_action' => 'return_to_edit']
|
||||
);
|
||||
$I->seeRecord('categories', ['name' => 'Savings accountXX']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user