diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 5 | ||||
-rw-r--r-- | t/app/controller/report_new_update.t | 4 |
3 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bc23c6a6..ac1958e86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - Do not trigger duplicate check when checking stoppers - Do not strip spaces from middle of Open311 category codes. #3167 - Show all category history even if category renamed. + - Fix email alert on initial update template. - Admin improvements: - Display user name/email for contributed as reports. #2990 - Interface for enabling anonymous reports for certain categories. #2989 diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 037e1992a..3b42085ff 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -1736,7 +1736,10 @@ sub create_related_things : Private { my $request = { service_request_id => $problem->id, update_id => 'auto-internal', - comment_time => DateTime->now, + # Add a second so it is definitely later than problem confirmed timestamp, + # which uses current_timestamp (and thus microseconds) whilst this update + # is rounded down to the nearest second + comment_time => DateTime->now->add( seconds => 1 ), status => 'open', description => $description, }; diff --git a/t/app/controller/report_new_update.t b/t/app/controller/report_new_update.t index cbb31cea4..e20975c3a 100644 --- a/t/app/controller/report_new_update.t +++ b/t/app/controller/report_new_update.t @@ -1,4 +1,5 @@ use FixMyStreet::TestMech; +use FixMyStreet::Script::Alerts; # disable info logs for this test run FixMyStreet::App->log->disable('info'); @@ -43,6 +44,9 @@ subtest "test report creation with initial auto-update" => sub { is $comment->user->id, $comment_user->id; is $comment->external_id, 'auto-internal'; is $comment->name, 'Glos Council'; + + FixMyStreet::Script::Alerts::send(); + my $email = $mech->get_email; }; done_testing; |