aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/TestMech.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2014-07-10 15:28:54 +0100
committerMatthew Somerville <matthew@mysociety.org>2014-07-10 17:23:09 +0100
commit5aab29046bbc602bb63a647f61f5b9fd4fe137cd (patch)
treee1b54449b7a94ef777702e4d0b800a88cf308e00 /perllib/FixMyStreet/TestMech.pm
parent49cb1e91e0cf01e27843f4c8e22731b7d28c049e (diff)
Add fixmystreet.com reporting form A/B tests.
Testing two things: * Putting the email box above the Yes/No, or repeating it inside. * Showing the contents of the Yes/No sections at first, or not.
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r--perllib/FixMyStreet/TestMech.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm
index be8f004a5..5b3cc39a7 100644
--- a/perllib/FixMyStreet/TestMech.pm
+++ b/perllib/FixMyStreet/TestMech.pm
@@ -238,7 +238,10 @@ sub page_errors {
process 'div.form-error, p.form-error, p.error, ul.error li', 'errors[]', 'TEXT';
}
->scrape( $mech->response );
- return $result->{errors} || [];
+ my $err = $result->{errors} || [];
+ my %seen = ();
+ $err = [ grep { not $seen{$_}++ } @$err ];
+ return $err;
}
=head2 import_errors
@@ -479,6 +482,10 @@ sub visible_form_values {
my %params = map { $_ => $form->value($_) } @visible_field_names;
+ # Ignore content experiment fields
+ delete $params{email_y};
+ delete $params{email_n};
+
return \%params;
}