You are here

public function FaqExistsFaq_AskTestCase::testFaq_AskExist in FAQ_Ask 7

Check for existing FAQ page and the posibility to create a FAQ by user

File

./faq_ask.test, line 523
Test Faq_Ask functionality Base test class. All tests inherits this one Hugely based on code from the test file block.test by boombatower

Class

FaqExistsFaq_AskTestCase

Code

public function testFaq_AskExist() {

  // Create and log in user with create FAQ permissions
  $this
    ->drupalLogin($this->ask_user);
  $this
    ->drupalGet("faq_ask");

  // Verify that all the fields are there
  //    $this->assertFieldById('edit-taxonomy-tags-' . $this->tax['id']);
  //    $this->assertFieldByName('taxonomy[tags][' . $this->tax['id'] . ']');
  $this
    ->assertFieldById('edit-title');
  $this
    ->assertFieldByName('title');
  $this
    ->assertFieldById('edit-detailed-question');
  $this
    ->assertFieldByName('detailed_question');

  // The answer field should not be there
  $this
    ->assertNoFieldByName('body');

  // No published status field
  // $this->assertNoFieldChecked('status');  // Turns out this one is not accessible for someone asking questions
  // Leave the logged in state
  $this
    ->drupalLogout();
}