aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-01-31 17:52:47 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-02-01 10:19:42 +0000
commit15b55b907213d3a170d9a2f6113077ad91a3c6c8 (patch)
treedbdabcc7e9754931992385f374c62064efd644bd /t
parentb5cc0b4b866f576dc52587d9e993a221d476ef65 (diff)
Add CSRF and time to contact form.
Diffstat (limited to 't')
-rw-r--r--t/app/controller/contact.t3
1 files changed, 3 insertions, 0 deletions
diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t
index fe67e89ec..bf157d699 100644
--- a/t/app/controller/contact.t
+++ b/t/app/controller/contact.t
@@ -13,6 +13,7 @@ use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
$mech->get_ok('/contact');
+my ($csrf) = $mech->content =~ /meta content="([^"]*)" name="csrf-token"/;
$mech->title_like(qr/Contact Us/);
$mech->content_contains("It's often quickest to ");
@@ -444,6 +445,7 @@ for my $test (
{
fields => {
%common,
+ token => $csrf,
dest => 'from_council',
success_url => '/faq',
},
@@ -452,6 +454,7 @@ for my $test (
{
fields => {
%common,
+ token => $csrf,
dest => 'from_council',
success_url => 'http://www.example.com',
},