From 910ad45bee6ba7c0865ab3ac9a8ce1c97faaa0e9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 14 Feb 2015 17:35:45 +0100 Subject: [PATCH] Update test [skip ci] --- tests/functional/AccountControllerCest.php | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/tests/functional/AccountControllerCest.php b/tests/functional/AccountControllerCest.php index 6dbf30e182..ebf2c3205d 100644 --- a/tests/functional/AccountControllerCest.php +++ b/tests/functional/AccountControllerCest.php @@ -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); } /**