diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2013-12-20 12:52:01 +0000 |
---|---|---|
committer | Hakim Cassimally <hakim@mysociety.org> | 2013-12-20 12:56:39 +0000 |
commit | 5c560e509daf57951d0a3a784022a7b75c7ab298 (patch) | |
tree | f12823628372001013a1032aefc2b2194fe32617 /t | |
parent | f835b7f31fc79985325f6286328eec1a4ee8db8a (diff) |
[Zurich] admin template to respect closed_overdue
This value is now cached, but the template calls the function,
calculating it anew, so for old reports (closed within SLA) the
problem_row.html template showed these as overdue. Instead, we point
the template at a function which first checks the cached value.
(Attempting to roll this functionality into the .overdue() method itself
caused a fair amount of collateral test breakage, and it seems safest to
extract the caching function for now.)
Closes https://github.com/mysociety/FixMyStreet-Commercial/issues/462
Diffstat (limited to 't')
-rw-r--r-- | t/cobrand/zurich.t | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t index f6cbeffed..86bfcccea 100644 --- a/t/cobrand/zurich.t +++ b/t/cobrand/zurich.t @@ -280,7 +280,11 @@ subtest "report_edit" => sub { is ( $report->extra->{closed_overdue}, 0, 'Marking hidden from scratch also set closed_overdue' ); is get_moderated_count(), 1; - reset_report_state($report); + is (FixMyStreet::Cobrand::Zurich->new->get_or_check_overdue($report), 0, 'sanity check'); + $report->update({ created => $created->clone->subtract(days => 10) }); + is (FixMyStreet::Cobrand::Zurich->new->get_or_check_overdue($report), 0, 'overdue call not increased'); + + reset_report_state($report, $created); }; FixMyStreet::override_config { |