]> BookStack Code Mirror - bookstack/blobdiff - tests/Auth/RegistrationTest.php
Fixed notification preferences URL in email
[bookstack] / tests / Auth / RegistrationTest.php
index ff1a9d66b11b8ad942490189ffe9b61dfde9e992..60ae17573eb1560df60d0f34ea4dfda1c96183f9 100644 (file)
@@ -184,4 +184,23 @@ class RegistrationTest extends TestCase
         $resp->assertSee('The email must be a valid email address.');
         $resp->assertSee('The password must be at least 8 characters.');
     }
+
+    public function test_registration_simple_honeypot_active()
+    {
+        $this->setSettings(['registration-enabled' => 'true']);
+
+        $resp = $this->get('/register');
+        $this->withHtml($resp)->assertElementExists('form input[name="username"]');
+
+        $resp = $this->post('/register', [
+            'name' => 'Barry',
+            'email' => '[email protected]',
+            'password' => 'barryIsTheBestBot',
+            'username' => 'MyUsername'
+        ]);
+        $resp->assertRedirect('/register');
+
+        $resp = $this->followRedirects($resp);
+        $this->withHtml($resp)->assertElementExists('form input[name="username"].text-neg');
+    }
 }