aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2019-01-15 12:39:15 +0000
committerStruan Donald <struan@exo.org.uk>2019-01-16 10:40:56 +0000
commit53624a3800db9500ad35900466aa44ad55e57c23 (patch)
tree00e0b57e12413f5269db4437951b064a50a3a627 /t/app/controller
parent4dac760f5d5291437667b28b39af41d29545bda3 (diff)
[Oxfordshire] length checking for names, emails and phone Nos
Add in validation to check names, email and phone numbers don't exceed maximum lengths permitted by HIAMS. Fixes mysociety/fixmystreet-commercial#1244
Diffstat (limited to 't/app/controller')
-rw-r--r--t/app/controller/report_new.t20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index 8290faac0..6dc659c19 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -594,6 +594,26 @@ foreach my $test (
changes => { },
errors => [ 'Please enter a subject', 'Please enter some details', 'Names are limited to 40 characters in length.' ],
},
+ {
+ msg => 'Oxfordshire validation',
+ pc => 'OX20 1SZ',
+ fields => {
+ title => '',
+ detail => '',
+ photo1 => '',
+ photo2 => '',
+ photo3 => '',
+ name => 'This is a really extraordinarily long name that definitely should fail validation',
+ may_show_name => '1',
+ username => 'bob.has.a.very.long.email@thisisalonghostname.example.com',
+ phone => '01234 5678910 09876 54321 ext 203',
+ category => 'Trees',
+ password_sign_in => '',
+ password_register => '',
+ },
+ changes => { },
+ errors => [ 'Please enter a subject', 'Please enter some details', 'Emails are limited to 50 characters in length.', 'Phone numbers are limited to 30 characters in length.', 'Names are limited to 70 characters in length.'],
+ },
)
{
subtest "check form errors where $test->{msg}" => sub {