aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
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
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')
-rw-r--r--t/app/controller/report_display.t2
-rw-r--r--t/app/controller/reports.t15
2 files changed, 14 insertions, 3 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t
index 2fc4fde9f..a20eec005 100644
--- a/t/app/controller/report_display.t
+++ b/t/app/controller/report_display.t
@@ -151,7 +151,7 @@ subtest "test duration string" => sub {
AREA_LINKS_FROM_PROBLEMS => 1,
}, sub {
$mech->get_ok("/report/$report_id");
- $mech->content_contains('Sent to <a href="http://localhost/reports/Westminster+City+Council">Westminster');
+ $mech->content_contains('Sent to <a href="/reports/Westminster+City+Council">Westminster');
};
};
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();