Merge pull request 'Remove dead code and validate new polls only once' (#33) from chore/remove-dead-code into main
Reviewed-on: #33
This commit was merged in pull request #33.
This commit is contained in:
commit
a62e13eeff
13 files changed
+78
-102
No files matched your search
@@ -70,6 +70,17 @@ class HomeControllerTest extends TestCase
|
||||
$this->assertResponseNotContains('/admin/', 'Admin link must not be shown when disabled');
|
||||
}
|
||||
|
||||
public function testCreateAcceptsEmailWithSurroundingSpaces(): void
|
||||
{
|
||||
$this->session(['Captcha.math.create' => 7]);
|
||||
$this->post('/create', ['title' => ' Retro ', 'email' => ' Owner@Example.org ', 'captcha_answer' => '7']);
|
||||
|
||||
$this->assertRedirect(['_name' => 'created']);
|
||||
$poll = $this->pollsTable()->find()->firstOrFail();
|
||||
$this->assertSame('Retro', $poll->title);
|
||||
$this->assertSame('owner@example.org', $poll->email);
|
||||
}
|
||||
|
||||
public function testIndexRendersHiddenHoneypot(): void
|
||||
{
|
||||
$this->get('/');
|
||||
|
||||
Reference in new issue
Block a user