You are here

public function ViewsRulesViewLoopTestCase::testViewLoopUI in Views Rules 7

Tests creation of a view loop.

File

tests/views_rules.test, line 215
Simpletest implementations.

Class

ViewsRulesViewLoopTestCase
Rules plugin tests.

Code

public function testViewLoopUI() {

  // Check redirection.
  rules_action_set(array(
    'term' => array(
      'type' => 'taxonomy_term',
      'label' => 'Term',
    ),
  ))
    ->save('test');
  $this
    ->drupalGet('admin/config/workflow/rules/components/manage/test/add/1/view loop');
  $this
    ->assertUrl('admin/config/workflow/rules/components/manage/test/add-view-loop/1', array(), 'Form redirects when adding a view loop.');

  // Create view loop.
  $this
    ->drupalPost(NULL, array(
    'views_rules_display' => 'views_rules_non_field_test:views_rules_1',
  ), t('Continue'));
  $this
    ->drupalPost(NULL, array(), t('Switch to data selection'));
  $this
    ->drupalPost(NULL, array(
    'parameter[tid][settings][tid:select]' => 'term:tid',
  ), t('Save'));
  $this
    ->assertUrl('admin/config/workflow/rules/components/manage/test', array(), 'View loop creation form is saved.');
  $this
    ->assertLinkByHref('admin/structure/views/view/views_rules_non_field_test/edit/views_rules_1', 0, 'View loop can be added via UI.');
}