You are here

function ClassifiedBasicTest::test1382234 in Classified Ads 6.3

Issue #1382234: Create new ad link missing.

Root cause: improper caching.

File

tests/classified_basic.test, line 375
Basic test for known bugs in previous versions.

Class

ClassifiedBasicTest

Code

function test1382234() {
  $this->group = __FUNCTION__;
  $accounts = array(
    'creator',
  );
  $this
    ->createUsers($accounts);
  $this
    ->drupalLogin($this->creatorUser);

  // Force caching of overview page
  cache_clear_all('classified:overview', 'cache');
  $this
    ->drupalGet('classified');
  $this
    ->assertLink(t('Add one'), 0, t('Creator sees ad creation link.'));

  // Anonymous should not get creation link from page cached for authenticated users.
  $this
    ->drupalLogout();
  $this
    ->drupalGet('classified');
  $this
    ->assertNoLink(t('Add one'), t('Anonymous users do not see ad creation link.'));
  cache_clear_all('classified:overview', 'cache');
  $this
    ->drupalGet('classified');
  $this
    ->assertNoLink(t('Add one'), t('Anonymous users do not see ad creation link.'));

  // Creator user should see the Add one link on the cached page.
  $this
    ->drupalLogin($this->creatorUser);
  $this
    ->drupalGet('classified');
  $this
    ->assertLink(t('Add one'), 0, t('Creator sees ad creation link.'));
}