You are here

public function WebformRemotePostTestCase::testCanAddATarget in Webform Remote Post 7

File

tests/webform_remote_post.test, line 34

Class

WebformRemotePostTestCase
Tests the functionality of the Webform Remote Post module.

Code

public function testCanAddATarget() {
  $this
    ->drupalGet('node/add/webform');
  $edit = array();
  $edit['title'] = 'Sample Webform';
  $this
    ->drupalPost('node/add/webform', $edit, t('Save'));
  $this
    ->assertText(t('Webform Sample Webform has been created.'));
  echo $this
    ->drupalGetContent();
  $this
    ->clickLink(t('Remote Posts'));
  $this
    ->assertText(t('No remote target URLs specified yet.'));
  $edit = array(
    'add[label]' => 'Request Bin',
    'add[url]' => 'http://requestb.in/1i7x5vo1',
  );
  $this
    ->drupalPost(null, $edit, t('Add'));
  $this
    ->assertText('Edit remote post settings');
  $this
    ->drupalPost(null, array(), t('Save remote post settings'));
  $this
    ->assertText('Request Bin');
  $this
    ->assertText('http://requestb.in/1i7x5vo1');
}