aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-03-23 18:11:27 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-03-23 18:48:56 +0000
commita8ceae6c99b00aefcba301b2f41033d84701f56a (patch)
treee25f1babbaaf3f8c75c686116952c2b5a31fbd31
parent6713d6a4cd04a6e91743f687347367f070538e63 (diff)
Fix bug if test run c. 55 hours before BST starts.
The code was adding two days and seven/eight hours to a floating DateTime, which from 5-7pm on 23rd March 2017 created a DateTime between 1-2am on 26th March which does not exist in e.g. the UK.
-rw-r--r--t/app/controller/alert_new.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t
index 729f3a267..ea38f7c25 100644
--- a/t/app/controller/alert_new.t
+++ b/t/app/controller/alert_new.t
@@ -371,7 +371,7 @@ subtest "Test normal alert signups and that alerts are sent" => sub {
}
}
- my $dt = DateTime->now()->add( days => 2);
+ my $dt = DateTime->now(time_zone => 'Europe/London')->add(days => 2);
my $dt_parser = FixMyStreet::App->model('DB')->schema->storage->datetime_parser;
@@ -486,7 +486,7 @@ subtest "Test signature template is used from cobrand" => sub {
my $user2 = $mech->create_user_ok('alerts@example.com', name => 'Alert User' );
- my $dt = DateTime->now()->add( days => 2);
+ my $dt = DateTime->now(time_zone => 'Europe/London')->add(days => 2);
my $dt_parser = FixMyStreet::App->model('DB')->schema->storage->datetime_parser;