You are here

function SemanticFieldsPermissionsTestCase::testPermission in Semantic Fields 7

Tests access to Semantic fields configuration.

File

./semantic_fields.test, line 28
Tests for semantic_fields.module.

Class

SemanticFieldsPermissionsTestCase
@file Tests for semantic_fields.module.

Code

function testPermission() {
  $this
    ->drupalLogin($this->privileged_user);
  $this
    ->drupalGet('admin/structure/semantic_fields');
  $this
    ->assertResponse(200, t('User allowed.'));

  // Create preset.
  $preset = testPreset('Ipsum');
  $this
    ->drupalPost('admin/structure/semantic_fields/add', $preset, t('Save'));
  $this
    ->assertText('ipsum has been created.', t('The ipsum preset were created'));

  // Import preset. @todo: make this work ...
  // $preset_import['import'] = testImportPreset();

  //$this->drupalPost('admin/structure/semantic_fields/import', $preset_import, t('Continue'));
  $this
    ->drupalLogin($this->simple_user);
  $this
    ->drupalGet('admin/structure/semantic_fields');
  $this
    ->assertResponse(403, t('User denied.'));
}