From 2d87d6bf7c7fa4eae0e098586a0efe04c5d866fe Mon Sep 17 00:00:00 2001 From: M Somerville Date: Thu, 8 Oct 2020 11:31:21 +0100 Subject: Fix email alert on initial update template. A report's confirmation timestamp uses current_timestamp, and so includes microseconds. An initial update text, to fit in with the Open311 handling of updates, uses a DateTime object, which does not. This means if a report is created when logged in, the initial update can have a timestamp earlier than the report, and so is not alerted on. --- t/app/controller/report_new_update.t | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't/app/controller/report_new_update.t') 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; -- cgit v1.2.3