You are here

public function AdsTxtBasicTestCase::testAdsTxtAdminAccess in AdsTxt 7

Checks that an administrator can view the configuration page.

File

./adstxt.test, line 36
Tests for adstxt.module.

Class

AdsTxtBasicTestCase
Tests basic functionality of configured ads.txt files.

Code

public function testAdsTxtAdminAccess() {

  // Create an admin user, log in and access settings form.
  $admin_user = $this
    ->drupalCreateUser(array(
    'administer ads.txt',
  ));
  $this
    ->drupalLogin($admin_user);
  $this
    ->drupalGet('admin/config/system/adstxt');
  $this
    ->assertResponse(200);
  $this
    ->assertFieldById('edit-adstxt', NULL, 'The textarea for configuring ads.txt is shown.');
}