Index: modules/simpletest/tests/poll_js_add_choice.test =================================================================== RCS file: modules/simpletest/tests/poll_js_add_choice.test diff -N modules/simpletest/tests/poll_js_add_choice.test --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/poll_js_add_choice.test 12 Oct 2008 03:28:43 -0000 @@ -0,0 +1,31 @@ + t('Poll add choice'), + 'description' => t('Submits a POST request for an additional poll choice.'), + 'group' => t('Poll') + ); + } + + /** + * Implementation of setUp(). + */ + function setUp() { + $user = $this->drupalCreateUser(array('create poll content')); + $this->drupalLogin($user); + } + + function testAddChoice() { + // response is in JSON, so decode it to test + $response = $this->drupalPost('node/add/poll', array(), t('More choices')); + $response = json_decode($response); + $this->assertTrue($response['status'], 'Response status is true'); + $this->assertTrue($response['data'], 'Response contains data'); + } +} \ No newline at end of file