diff options
author | Dave Arter <davea@mysociety.org> | 2017-09-13 15:27:28 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2017-09-13 17:10:02 +0100 |
commit | 0127d143d701e452286b0ee853dc92e3267919ca (patch) | |
tree | 968f71197da0665501d3864ac7c0406e9d6d1655 /t | |
parent | e466e4db9be320953fbda98e3fbb291c8fe067dc (diff) |
[Oxfordshire] Use local time for rdi_processed, not UTC
Diffstat (limited to 't')
-rw-r--r-- | t/cobrand/oxfordshire.t | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/t/cobrand/oxfordshire.t b/t/cobrand/oxfordshire.t index e6c16950c..a79a8f2a4 100644 --- a/t/cobrand/oxfordshire.t +++ b/t/cobrand/oxfordshire.t @@ -1,3 +1,5 @@ + +use Test::MockModule; use FixMyStreet::Integrations::ExorRDI; use FixMyStreet::TestMech; @@ -158,6 +160,13 @@ subtest 'Reports are marked as inspected correctly' => sub { ALLOWED_COBRANDS => [ 'oxfordshire' ], }, sub { my $date = DateTime->new(year => 2017, month => 5, day => 5, hour => 12); + + my $now = DateTime->now( + time_zone => FixMyStreet->time_zone || FixMyStreet->local_time_zone + ); + my $datetime = Test::MockModule->new('DateTime'); + $datetime->mock('now', sub { $now }); + my $params = { start_date => $date, end_date => $date, @@ -168,10 +177,9 @@ subtest 'Reports are marked as inspected correctly' => sub { my $rdi = FixMyStreet::Integrations::ExorRDI->new($params); $rdi->construct; - my $now = DateTime->now->strftime( '%Y-%m-%d %H:%M' ); foreach my $problem (@problems) { $problem->discard_changes; - is $problem->get_extra_metadata('rdi_processed'), $now, "Problem was logged as sent in RDI"; + is $problem->get_extra_metadata('rdi_processed'), $now->strftime( '%Y-%m-%d %H:%M' ), "Problem was logged as sent in RDI"; } }; }; |