summaryrefslogtreecommitdiff
path: root/modules/poll/poll.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/poll/poll.test')
-rw-r--r--modules/poll/poll.test11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/poll/poll.test b/modules/poll/poll.test
index d7648a6ba..f6f82dfd6 100644
--- a/modules/poll/poll.test
+++ b/modules/poll/poll.test
@@ -205,11 +205,12 @@ class PollCreateTestCase extends PollTestCase {
$new_option = $this->randomName();
+ $vote_count = '2000';
$node->choice[] = array(
'chid' => '',
'chtext' => $new_option,
- 'chvotes' => 0,
- 'weight' => 0,
+ 'chvotes' => (int) $vote_count,
+ 'weight' => 1000,
);
node_save($node);
@@ -217,6 +218,12 @@ class PollCreateTestCase extends PollTestCase {
$this->drupalGet('poll');
$this->clickLink($title);
$this->assertText($new_option, 'New option found.');
+
+ $option = $this->xpath('//div[@id="node-1"]//div[@class="poll"]//div[@class="text"]');
+ $this->assertEqual(end($option), $new_option, 'Last item is equal to new option.');
+
+ $votes = $this->xpath('//div[@id="node-1"]//div[@class="poll"]//div[@class="percent"]');
+ $this->assertTrue(strpos(end($votes), $vote_count) > 0, t("Votes saved."));
}
function testPollClose() {