function RulesAdminMinimalProfileTestCase::testNodeEventUi

Tests node event UI without content types.

See also

https://www.drupal.org/project/rules/issues/2267341

File

rules_admin/tests/rules_admin_minimal_profile.test, line 49

Class

RulesAdminMinimalProfileTestCase
UI test cases for the minimal profile.

Code

public function testNodeEventUi() {
    // Create a simple user account with permission to create a rule.
    $user = $this->drupalCreateUser(array(
        'access administration pages',
        'administer rules',
    ));
    $this->drupalLogin($user);
    $this->drupalGet('admin/config/workflow/rules/reaction/add');
    $edit = array(
        'settings[label]' => 'Test node event',
        'settings[name]' => 'test_node_event',
        'event' => 'node_insert',
    );
    $this->drupalPostAJAX(NULL, $edit, 'event');
    $this->assertText('Restrict by type', 'Restrict by type selection is visible.');
    $this->drupalPost(NULL, $edit, 'Save');
    $this->assertText('Editing reaction rule', 'Rule edit page is shown.');
}