aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-03-31 14:38:23 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-03-31 14:46:06 +0100
commitdc5e30296d78b3171188acaef8bca1ae4e7b4596 (patch)
treebe6d806a385b9a74ff5d97d1abad34417488b75e
parent7d0362ca6a8db2909bbd550edc267f31c24bc42e (diff)
Fix test issue running on PostgreSQL>=9.2 on Mac.
Test::PostgreSQL sets up a new database with initdb and empties the generated postgresql.conf; PostgreSQL 9.2+ sets its locale/timezone information at the initdb stage, not when it is run. It is possible therefore for the tests to be in one timezone but the test database to be in another (GMT) – causing a test failure when e.g. an update is created manually. Make sure the first comment is well before the others being tested, so there is no chance the order gets confused.
-rw-r--r--t/app/controller/report_updates.t3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index f9f5189e5..7b4bf7854 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -760,7 +760,8 @@ subtest 'check meta correct for comments marked confirmed but not marked open' =
user => $user,
problem_id => $report->id,
text => 'update text',
- confirmed => DateTime->now( time_zone => 'local' ),
+ # Subtract a day to deal with any code/db timezone difference
+ confirmed => DateTime->now( time_zone => 'local' ) - DateTime::Duration->new( days => 1 ),
problem_state => 'confirmed',
anonymous => 0,
mark_open => 0,