diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-18 15:48:00 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-18 15:48:00 +0100 |
commit | c40da27da59b74c32db0a50a2a03473ec4cdba2c (patch) | |
tree | 0113a608b5e45edf690ce9504d6ca4c8445a24f5 /t | |
parent | 6b304e144051fe6d531ca475cd6fe43fd3705c7f (diff) |
initial problem update reporting. only does basic validation so far
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/report_updates.t | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index a3a612c95..1ecdef96d 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -187,6 +187,35 @@ subtest "several updates shown in correct order" => sub { is $meta->[2], 'Posted anonymously at 08:12, Tuesday 15 March 2011, marked as fixed', 'third update'; }; +for my $test ( + { + fields => { + rznvy => '', + update => '', + name => '', + }, + field_errors => [ 'Please enter your email', 'Please enter a message' ] + }, + { + fields => { + rznvy => 'test', + update => '', + name => '', + }, + field_errors => [ 'Please enter a valid email', 'Please enter a message' ] + }, + ) +{ + subtest "submit an update" => sub { + $mech->get_ok("/report/$report_id"); + + $mech->submit_form_ok( { with_fields => $test->{fields} }, + 'submit update' ); + + is_deeply $mech->form_errors, $test->{field_errors}, 'field errors'; + }; +} + ok $comment->delete, 'deleted comment'; $mech->delete_user('commenter@example.com'); $mech->delete_user('test@example.com'); |