aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/reports.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-10-10 13:16:12 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-10-10 13:21:36 +0100
commitf8a4d8f97dfc2e61854bb423594e669de7e63aef (patch)
treea42d9c5808fa6806454deaee9436f892de160750 /t/app/controller/reports.t
parent8f99184aec230770c62237e060bc9af02b06a3e6 (diff)
Have body.url work in hashref lookup.
body.url could still be in use by old-school /reports table index pages (though they were dropped in 2.1, so a cobrand would have to have overridden it since then) and the update to speed up body lists in #2248 broke it. This puts it back in minimal form.
Diffstat (limited to 't/app/controller/reports.t')
-rw-r--r--t/app/controller/reports.t15
1 files changed, 13 insertions, 2 deletions
diff --git a/t/app/controller/reports.t b/t/app/controller/reports.t
index 3c18b1383..66af2778d 100644
--- a/t/app/controller/reports.t
+++ b/t/app/controller/reports.t
@@ -95,8 +95,19 @@ $fife_problems[10]->update( {
state => 'hidden',
});
-# Run the cron script old-data (for the table no longer used by default)
-FixMyStreet::Script::UpdateAllReports::generate(1);
+FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'fixmystreet',
+}, sub {
+ subtest 'Test the cron script old-data (for the table no longer used by default)' => sub {
+ FixMyStreet::Script::UpdateAllReports::generate(1);
+
+ # Old style page no longer exists in core, but let's just check the code works okay
+ my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('fixmystreet')->new();
+ FixMyStreet::DB->schema->cobrand($cobrand);
+ my @bodies = FixMyStreet::DB->resultset('Body')->active->translated->all_sorted;
+ is $bodies[0]->{url}->(), '/reports/Birmingham';
+ };
+};
# Run the cron script that makes the data for /reports so we don't get an error.
my $data = FixMyStreet::Script::UpdateAllReports::generate_dashboard();