aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/app/controller/moderate.t8
-rw-r--r--t/app/controller/report_new.t20
2 files changed, 26 insertions, 2 deletions
diff --git a/t/app/controller/moderate.t b/t/app/controller/moderate.t
index a3474449f..438a81b25 100644
--- a/t/app/controller/moderate.t
+++ b/t/app/controller/moderate.t
@@ -257,8 +257,12 @@ subtest 'Problem moderation' => sub {
$report->discard_changes;
is $report->get_extra_metadata('weather'), 'snow';
is $report->get_extra_metadata('moon'), 'waning full';
- is $report->moderation_original_data->get_extra_metadata('moon'), 'waxing full';
- is $report->moderation_original_data->get_extra_metadata('weather'), undef;
+ my $mod = $report->moderation_original_data;
+ is $mod->get_extra_metadata('moon'), 'waxing full';
+ is $mod->get_extra_metadata('weather'), undef;
+
+ my $diff = $mod->extra_diff($report, 'moon');
+ is $diff, "wa<del style='background-color:#fcc'>x</del><ins style='background-color:#cfc'>n</ins>ing full", 'Correct diff';
};
subtest 'Moderate category' => sub {
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 {