You are here

public function AnswersTest::testAddContentPage in Answers 8

Tests that the reaction rule listing page works.

File

tests/src/Functional/AnwsersTest.php, line 31

Class

AnswersTest
Tests that the Rules UI pages are reachable.

Namespace

Drupal\Tests\answers\Functional

Code

public function testAddContentPage() {
  $account = $this
    ->drupalCreateUser();
  $this
    ->drupalLogin($account);
  $this
    ->drupalGet('node/add/answers-question');
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Test that there is an empty reaction rule listing.
  // @todo In Drupal 8.6.x the text changed from 'There is no Reaction Rule'
  // to 'There are no reaction rules'. Remove this once 8.5.x is unsupported.
  // @see https://www.drupal.org/project/rules/issues/2989050
  // if (version_compare(substr(\Drupal::VERSION, 0, 3), '8.6', '>=')) {
  //   $this->assertSession()->pageTextContains('There are no reaction rules yet.');
  // }
  // else {
  //   $this->assertSession()->pageTextContains('There is no Reaction Rule yet.');
  // }
}