aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/report_new.t25
1 files changed, 24 insertions, 1 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index 61f009619..dca86db77 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -380,11 +380,35 @@ subtest "test report creation for a user who is logged in" => sub {
$mech->clear_emails_ok;
my $user = $mech->log_in_ok($test_email);
+ # setup the user.
+ ok $user->update(
+ {
+ name => 'Test User',
+ phone => '01234 567 890',
+ }
+ ),
+ "set users details";
+
# submit initial pc form
$mech->get_ok('/report/new');
$mech->submit_form_ok( { with_fields => { pc => 'SW1A 1AA', } },
"submit location" );
+ # check that the fields are correctly prefilled
+ is_deeply(
+ $mech->visible_form_values,
+ {
+ title => '',
+ detail => '',
+ may_show_name => '1',
+ email => $test_email,
+ name => 'Test User',
+ phone => '01234 567 890',
+ photo => '',
+ },
+ "user's details prefilled"
+ );
+
TODO: {
local $TODO =
"'/report/<<id>>' not handled by catalyst yet - form creation redirects to there on success if logged in";
@@ -397,7 +421,6 @@ subtest "test report creation for a user who is logged in" => sub {
photo => '',
name => 'Joe Bloggs',
may_show_name => '1',
- email => $test_email,
phone => '07903 123 456',
}
},