From 1c519917ad610f6922f3108c8313e613cbd071a1 Mon Sep 17 00:00:00 2001 From: webchick Date: Wed, 11 Jan 2012 23:19:53 -0500 Subject: Issue #1295546 by c31ck, marcingy, amateescu, xjm: Fixed Weight and number of votes not getting saved when updating a poll. --- modules/poll/poll.test | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'modules/poll/poll.test') 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() { -- cgit v1.2.3