Update test [skip ci]

This commit is contained in:
James Cole 2015-02-14 17:35:45 +01:00
parent 74e319855d
commit 910ad45bee

View File

@ -41,9 +41,11 @@ class AccountControllerCest
*/
public function delete(FunctionalTester $I)
{
$account = Account::where('name', 'Delete me')->first();
$I->wantTo('delete an asset account');
$I->amOnPage('/accounts/delete/3');
$I->see('Delete account "Delete me"');
$I->amOnPage('/accounts/delete/'.$account->id);
$I->see('Delete account');
$I->see($account->name);
}
/**
@ -51,9 +53,11 @@ class AccountControllerCest
*/
public function destroy(FunctionalTester $I)
{
$account = Account::where('name', 'Delete me')->first();
$I->wantTo('destroy an asset account');
$I->amOnPage('/accounts/delete/3');
$I->see('Delete account "Delete me"');
$I->amOnPage('/accounts/delete/'.$account->id);
$I->see('Delete account');
$I->see($account->name);
$I->submitForm('#destroy', []);
$I->dontSeeRecord('accounts', ['id' => 3, 'deleted_at' => null]);
}
@ -63,9 +67,11 @@ class AccountControllerCest
*/
public function edit(FunctionalTester $I)
{
$account = Account::where('name', 'Delete me')->first();
$I->wantTo('edit an asset account');
$I->amOnPage('/accounts/edit/3');
$I->see('Edit asset account "Delete me"');
$I->amOnPage('/accounts/edit/'.$account->id);
$I->see('Edit asset account');
$I->see($account->name);
}
/**
@ -73,9 +79,11 @@ class AccountControllerCest
*/
public function failUpdate(FunctionalTester $I)
{
$account = Account::where('name', 'Delete me')->first();
$I->wantTo('update an asset account and fail');
$I->amOnPage('/accounts/edit/3');
$I->see('Edit asset account "Delete me"');
$I->amOnPage('/accounts/edit/'.$account->id);
$I->see('Edit asset account');
$I->see($account->name);
$I->submitForm('#update', ['name' => '', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'update']);
$I->seeRecord('accounts', ['name' => 'Delete me']);
@ -97,10 +105,11 @@ class AccountControllerCest
*/
public function show(FunctionalTester $I)
{
$account = Account::where('name', 'Delete me')->first();
$I->wantTo('see one account');
$I->amOnPage('/accounts/show/3');
$I->amOnPage('/accounts/show/'.$account->id);
$I->see('Details for');
$I->see('Delete me');
$I->see($account->name);
}
/**