You are here

function ShoutboxViewTestCase::testShoutboxViewForm in Shoutbox 7

Same name and namespace in other branches
  1. 7.2 shoutbox.test \ShoutboxViewTestCase::testShoutboxViewForm()

Test that we can get an edit form.

File

./shoutbox.test, line 134
Shoutbox testing.

Class

ShoutboxViewTestCase

Code

function testShoutboxViewForm() {

  // Verify block appears in a block..
  $this
    ->drupalGet('');

  // If a 'block' view not generated, this title would not appear.
  $this
    ->assertText(t('Shoutbox'), 'Shoutbox appears in block.');
  $this
    ->assertText(t('There are currently no shouts'), 'There should be no shouts');

  // Verify that we don't have permission to edit the shoutbox
  $this
    ->assertText(t('You\'re not permitted to post shouts.'), 'User does not have permission to post a shout.');

  // Logout and login back in as a user who can post shouts.
  $this
    ->drupalLogout();
  $this
    ->drupalLogin($this->sb_super_user);
  $this
    ->drupalGet('');

  // make sure form is available
  $this
    ->assertFieldById('edit-message', '', 'The edit-messsage exists on the page');
}