diff --git a/regcode.install b/regcode.install
index bc944be..2f2bbf0 100644
--- a/regcode.install
+++ b/regcode.install
@@ -49,7 +49,7 @@ function regcode_schema() {
       'code' => [
         'description' => 'The registration code',
         'type' => 'varchar',
-        'length' => '255',
+        'length' => '191',
         'not null' => TRUE,
         'default' => '',
       ],
diff --git a/tests/src/Functional/RegcodeSettingsTest.php b/tests/src/Functional/RegcodeSettingsTest.php
new file mode 100644
index 0000000..20894bb
--- /dev/null
+++ b/tests/src/Functional/RegcodeSettingsTest.php
@@ -0,0 +1,83 @@
+<?php
+
+namespace Drupal\Tests\regcode\Functional;
+
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests operation of the Regcode settings page.
+ *
+ * @group regcode
+ */
+class RegcodeSettingsTest extends BrowserTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected static $modules = ['regcode', 'help', 'block'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
+  /**
+   * Admin user.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $adminUser;
+
+  /**
+   * Authenticated but unprivileged user.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $unprivUser;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp(): void {
+    parent::setUp();
+
+    // System help block is needed to see output from hook_help().
+    $this->drupalPlaceBlock('help_block', ['region' => 'help']);
+
+    // Create our test users.
+    $this->adminUser = $this->createUser([
+      'administer site configuration',
+      'access administration pages',
+      'administer registration codes',
+    ]);
+    $this->unprivUser = $this->createUser();
+  }
+
+  /**
+   * Tests module permissions / access to configuration page.
+   */
+  public function testUserAccess() {
+    /** @var \Drupal\Tests\WebAssert $assert */
+    $assert = $this->assertSession();
+
+    // Test as anonymous user.
+    $this->drupalGet('admin/config/people/regcode/settings');
+    $assert->statusCodeEquals(403);
+    $assert->pageTextContains('Access denied');
+    $assert->pageTextContains('You are not authorized to access this page.');
+
+    // Test as authenticated but unprivileged user.
+    $this->drupalLogin($this->unprivUser);
+    $this->drupalGet('admin/config/people/regcode/settings');
+    $assert->statusCodeEquals(403);
+    $this->drupalLogout();
+
+    // Test as admin user.
+    $this->drupalLogin($this->adminUser);
+    $this->drupalGet('admin/config/people/regcode/settings');
+    $assert->statusCodeEquals(200);
+    $assert->pageTextContains('Configure the registration code module.');
+    $this->drupalLogout();
+  }
+
+}
