Index: story_edit.test =================================================================== RCS file: modules/simpletest/tests/story_edit.test diff -N modules/simpletest/tests/story_edit.test --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/story_edit.test 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,57 @@ + 'story_edit Test', + 'desc' => t('We want a working edit for storys, uh?'), + 'group' => 'Node Tests', + ); + } + function testStoryEdit() { + /* Prepare settings */ + $this->drupalVariableSet('node_options_page', array('status', 'promote')); + /* Prepare a user to do the stuff */ + $web_user = $this->drupalCreateUserRolePerm(array('edit own page content', 'create page content')); + $this->drupalLoginUser($web_user); + $edit = array('title'=>$this->randomName(20), + 'body'=>$this->randomName(200)); + + //Create the page to edit + $this->drupalPostRequest('node/add/page', $edit, 'Save'); + + $this->clickLink('Edit'); + + $expectation1 = t('Edit'); + $expectation2 = t($edit['title']); + $expectation3 = t($edit['body']); + + $this->assertWantedText($expectation1, 'Preview text is here'); + $this->assertWantedText($expectation2, 'Hello, the random title'); + $this->assertWantedText($expectation3, 'test is over, the body\'s still there'); + + $edit = array('title'=>$this->randomName(20), + 'body'=>$this->randomName(200)); + + //edit the content of the page + $this->drupalPostRequest('node/add/page', $edit, 'Save'); + + $expectation1 = t($edit['title']); + $expectation2 = t($edit['body']); + + $this->assertWantedText($expectation1, 'Hello, the random title'); + $this->assertWantedText($expectation2, 'test is over, the body\'s still there'); + + + + } + +} + +?> Index: modules/simpletest/tests/story_preview.test =================================================================== RCS file: modules/simpletest/tests/story_preview.test diff -N modules/simpletest/tests/story_preview.test --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/story_preview.test 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,40 @@ + 'story_preview Test', + 'desc' => t('We want a working preview for storys, uh?'), + 'group' => 'Node Tests', + ); + } + function testStoryPreview() { + /* Prepare settings */ + $this->drupalVariableSet('node_options_page', array('status', 'promote')); + /* Prepare a user to do the stuff */ + $web_user = $this->drupalCreateUserRolePerm(array('edit own page content', 'create page content')); + $this->drupalLoginUser($web_user); + $edit = array('title'=>$this->randomName(20), + 'body'=>$this->randomName(200)); + + $this->drupalPostRequest('node/add/page', $edit, 'Preview'); + + $expectation1 = t('Preview'); + $expectation2 = t($edit['title']); + $expectation3 = t($edit['body']); + + $this->assertWantedText($expectation1, 'Preview text is here'); + $this->assertWantedText($expectation2, 'Hello, the random title'); + $this->assertWantedText($expectation3, 'test is over, the body\'s still there'); + + } + +} + +?>