You are here

public function MakemeetingPollAdminTestCase::testAnswerEvent in Make Meeting Scheduler 7.2

Test answering the makemeeting poll

File

./makemeeting.test, line 177
Makemeeting tests

Class

MakemeetingPollAdminTestCase
Test for the creation of a makemeeting poll.

Code

public function testAnswerEvent() {

  // Fill in a default event node form with some suggestions
  $this
    ->_testCreateField();
  $this
    ->_testFillMakemeetingForm();

  // Create the event as is
  $this
    ->drupalPost(NULL, array(), t('Save'));
  $this
    ->assertRaw('<input title="Tuesday 22 May 2012 23:15" type="checkbox" id="edit-answers-22-05-2012sugg1" name="answers[22-05-2012:sugg:1]" value="1" class="form-checkbox"', 'Checkboxes exist');

  // Test answering a poll
  $this
    ->assertRaw('<tr class="answer-form-row', 'Answer form exists');
  $this
    ->drupalPost(NULL, array(), t('Submit'));
  $this
    ->assertNoRaw('<tr class="answer-form-row', 'No answer form once submitted');

  // Test a single option form
  $this
    ->_testFillMakemeetingForm();
  $this
    ->drupalPost(NULL, array(
    'field_choose_date[und][0][one_option]' => '1',
  ), t('Save'));
  $this
    ->assertRaw('<input title="Tuesday 22 May 2012 23:15" type="radio" id="edit-answers--7" name="answers" value="22-05-2012:sugg:1" class="form-radio"', 'Radios exist');

  // Test a closed form
  $this
    ->_testFillMakemeetingForm();
  $this
    ->drupalPost(NULL, array(
    'field_choose_date[und][0][closed]' => '1',
  ), t('Save'));
  $this
    ->assertNoRaw('<input disabled="disabled" type="text" id="edit-name" name="name"');
}