From 78b9ef2df32ee7d62b72513670c3d013841c9d49 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 2 Dec 2013 18:36:17 +0100 Subject: [PATCH] More specific Behat assertion for page editability --- .../SilverStripe/Cms/Test/Behaviour/FixtureContext.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php index 207d4339..bd816ae7 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php @@ -55,14 +55,13 @@ class FixtureContext extends \SilverStripe\BehatExtension\Context\FixtureContext * @Then /^pages should( not? |\s*)be editable by "([^"]*)"$/ */ public function pagesShouldBeEditableBy($negative, $member){ - $edit = '"/admin/pages/edit"'; - $editable = 'I should'.$negative.'see an edit page form'; + $page = \Page::get()->First(); return array( new Step\Given('I am not logged in'), - new Step\Given('I am logged in with "'.$member.'" permissions'), - new Step\Given('I go to '.$edit), - new Step\Given($editable), + new Step\Given('I am logged in with "' . $member . '" permissions'), + new Step\Given('I go to "/admin/pages/edit/show/' . $page->ID . '"'), + new Step\Given('I should' . $negative . 'see a "Page name" field'), new Step\Then('I am on the homepage') ); }