# Copyright (c) 2006-2011 bivio Software, Inc. All Rights Reserved. # $Id: motion.btest,v 1.11 2011/07/28 20:04:12 moeller Exp $ test_setup('PetShop'); visit_uri((create_forum())[1]); follow_link('polls'); verify_text(qr/no polls/i); follow_link('new_poll'); verify_text(qr{one vote per user}i); my($motion) = 'Test Motion 1'; test_deviance('must supply a value'); submit_form({ name => $motion, }); test_conformance(); submit_form({ question => 'Do you like green?', }); verify_table('Name', [ ['Name', 'Start', 'End'], [$motion, qr/./, ''], ]); follow_link_in_table('Name', 'Name', $motion, 'Actions', 'Edit'); submit_form({ document => file_field('doc.txt', 'a document'), }); follow_link_in_table('Name', 'Name', $motion, 'Document', 'doc.txt'); verify_text('a document'); go_back(); follow_link_in_table('Name', 'Name', $motion, 'Actions', 'Edit'); submit_form({ document => file_field('doc.txt', 'a new document'), }); follow_link_in_table('Name', 'Name', $motion, 'Actions', 'Vote'); submit_form({ _radio => 'Yes', comment => 'green rules!', }); verify_table('Name', [ ['Name', qr/Votes/, 'Actions'], [$motion, '1/0/0', qr/vote/i], ]); follow_link_in_table('Name', 'Name', $motion, 'Actions', 'Comment'); submit_form({ comment => 'x', }); follow_link('polls'); follow_link_in_table('Name', 'Name', $motion, 'Actions', 'Edit'); submit_form({ name => 'Test Motion One', '_radio#0' => 'Closed', }); verify_text(qr/the poll has been saved/i); follow_link_in_table('Name', 'Name', 'Test Motion One', 'Actions', 'Status'); verify_table('Date', [ ['Vote', 'Comment'], ['Yes', 'green rules!'], ]); verify_table('Name', [ ['Name', 'Comment'], ['Root User', 'x'], ]); follow_link('vote_spreadsheet'); verify_text(qr/yes.*green rules/i); go_back(); follow_link('comment_spreadsheet'); verify_text(qr/Root User,x/i);