Index: modules/poll/poll.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.test,v
retrieving revision 1.2
diff -u -p -r1.2 poll.test
--- modules/poll/poll.test	25 Apr 2008 18:26:02 -0000	1.2
+++ modules/poll/poll.test	21 May 2008 22:04:27 -0000
@@ -8,30 +8,54 @@ class PollTestCase extends DrupalWebTest
     $web_user = $this->drupalCreateUser(array('create poll content', 'access content'));
     $this->drupalLogin($web_user);
     $title = $this->randomName();
+    $choices = array(
+      'choice 1',
+      'choice 2',
+      'choice 3',
+      'choice 4',
+      'choice 5',
+      'choice 6',
+      'choice 7',
+    );
+    
+    // Submit the form first with two choices
     $edit = array (
       'title' => $title,
-      'choice[0][chtext]' => 'choice 1',
-      'choice[1][chtext]' => 'choice 2',
+      'choice[new:0][chtext]' => $choices[0],
+      'choice[new:1][chtext]' => $choices[1],
     );
     $this->drupalPost('node/add/poll', $edit, t('More choices'));
+
+    // Re-submit the form with the other choices
     $edit = array(
       'title' => $title,
-      'choice[0][chtext]' => 'choice 1',
-      'choice[1][chtext]' => 'choice 2',
-      'choice[2][chtext]' => 'choice 3',
-      'choice[3][chtext]' => 'choice 4',
-      'choice[4][chtext]' => 'choice 5',
-      'choice[5][chtext]' => 'choice 6',
-      'choice[6][chtext]' => 'choice 7',
+      'choice[chid:0][chtext]' => $choices[0],
+      'choice[chid:1][chtext]' => $choices[1],
+      'choice[new:0][chtext]' => $choices[2],
+      'choice[new:1][chtext]' => $choices[3],
+      'choice[new:2][chtext]' => $choices[4],
+      'choice[new:3][chtext]' => $choices[5],
+      'choice[new:4][chtext]' => $choices[6],
     );
     if ($standalone) {
       $this->drupalPost(NULL, $edit, t('Preview'));
       for ($i = 0; $i <= 6; $i++) {
-        $bar = theme('poll_bar', $edit['choice['. $i .'][chtext]'], NULL, 0, FALSE, FALSE);
-        $this->assertTrue($bar, "bar $i is themed");
-        $this->assertRaw($bar, "bar $i found in preview");
+        $this->assertRaw($choices[$i], "Choice $i found in preview");
+        $themed_bar = theme('poll_bar', $choices[$i], 0, 0, FALSE, FALSE);
+        $this->assertRaw($themed_bar, "Choice $i bar is themed");
       }
+      $edit = array(
+        'title' => $title,
+        'choice[chid:0][chtext]' => $choices[0],
+        'choice[chid:1][chtext]' => $choices[1],
+        'choice[chid:2][chtext]' => $choices[2],
+        'choice[chid:3][chtext]' => $choices[3],
+        'choice[chid:4][chtext]' => $choices[4],
+        'choice[chid:5][chtext]' => $choices[5],
+        'choice[chid:6][chtext]' => $choices[6],
+      );
     }
+    
     $this->drupalPost(NULL, $edit, t('Save'));
     $node = node_load(array('title' => $title));
     $this->nid = $node->nid;
@@ -87,6 +111,8 @@ class PollVoteTestCase extends PollTestC
     $this->assertText('Your vote was recorded.', 'Your vote was recorded.');
     $this->drupalGet("node/$this->nid/votes");
     $this->assertText(t('This table lists all the recorded votes for this poll. If anonymous users are allowed to vote, they will be identified by the IP address of the computer they used when they voted.'), 'Vote table text.');
-    $this->assertText('choice 2', 'vote recorded');
+    $this->assertText('choice 1', 'Vote recorded');
+    echo $this->_content;
   }
 }
+
