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

@@ -35,6 +35,16 @@ class CurrencyControllerCest
$I->see('Create a new currency');
}
/**
* @param FunctionalTester $I
*/
public function defaultCurrency(FunctionalTester $I)
{
$I->wantTo('make US Dollar the default currency');
$I->amOnPage('/currency/default/2');
$I->see('US Dollar is now the default currency.');
}
/**
* @param FunctionalTester $I
*/
@@ -57,16 +67,6 @@ class CurrencyControllerCest
$I->see('Currency "Hungarian forint" deleted');
}
/**
* @param FunctionalTester $I
*/
public function defaultCurrency(FunctionalTester $I)
{
$I->wantTo('make US Dollar the default currency');
$I->amOnPage('/currency/default/2');
$I->see('US Dollar is now the default currency.');
}
/**
* @param FunctionalTester $I
*/
@@ -87,6 +87,19 @@ class CurrencyControllerCest
$I->see('Edit currency "US Dollar"');
}
/**
* @param FunctionalTester $I
*/
public function failUpdate(FunctionalTester $I)
{
$I->wantTo('update a currency and fail');
$I->amOnPage('/currency/edit/2');
$I->see('Edit currency "US Dollar"');
$I->submitForm('#update', ['name' => 'Failed update', 'code' => '123', 'post_submit_action' => 'update']);
$I->dontSeeRecord('transaction_currencies', ['name' => 'Failed update']);
}
/**
* @param FunctionalTester $I
*/
@@ -162,13 +175,15 @@ class CurrencyControllerCest
/**
* @param FunctionalTester $I
*/
public function failUpdate(FunctionalTester $I)
public function updateAndReturn(FunctionalTester $I)
{
$I->wantTo('update a currency and fail');
$I->wantTo('update a currency and return to form');
$I->amOnPage('/currency/edit/2');
$I->see('Edit currency "US Dollar"');
$I->submitForm('#update', ['name' => 'Failed update', 'code' => '123', 'post_submit_action' => 'update']);
$I->dontSeeRecord('transaction_currencies', ['name' => 'Failed update']);
$I->submitForm(
'#update', ['name' => 'US DollarXXX', 'symbol' => '$', 'code' => 'USD', 'post_submit_action' => 'return_to_edit']
);
$I->seeRecord('transaction_currencies', ['name' => 'US DollarXXX']);
}
@@ -185,19 +200,4 @@ class CurrencyControllerCest
$I->seeRecord('transaction_currencies', ['name' => 'US Dollar']);
}
/**
* @param FunctionalTester $I
*/
public function updateAndReturn(FunctionalTester $I)
{
$I->wantTo('update a currency and return to form');
$I->amOnPage('/currency/edit/2');
$I->see('Edit currency "US Dollar"');
$I->submitForm(
'#update', ['name' => 'US DollarXXX', 'symbol' => '$', 'code' => 'USD', 'post_submit_action' => 'return_to_edit']
);
$I->seeRecord('transaction_currencies', ['name' => 'US DollarXXX']);
}
}