From 5ce552af2b66613272dc9cfe2d46532e057f44f7 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 7 May 2020 12:44:23 +0100 Subject: Fix dashboard report CSV export. The change to join in e16054150 did not include a collapse that the previous prefetch was doing, so multiple rows per result were being returned. --- t/app/controller/dashboard.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't/app/controller/dashboard.t') diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t index 72fc00128..c62ada89a 100644 --- a/t/app/controller/dashboard.t +++ b/t/app/controller/dashboard.t @@ -70,6 +70,7 @@ foreach my $problem (@fixed_problems) { foreach my $problem (@closed_problems) { $problem->update({ state => 'closed' }); + $mech->create_comment_for_problem($problem, $counciluser, 'Name', 'in progress text', 0, 'confirmed', 'in progress'); $mech->create_comment_for_problem($problem, $counciluser, 'Title', 'text', 0, 'confirmed', 'closed'); } @@ -214,7 +215,7 @@ FixMyStreet::override_config { subtest 'export updates as csv' => sub { $mech->get_ok('/dashboard?updates=1&export=1'); my @rows = $mech->content_as_csv; - is scalar @rows, 15, '1 (header) + 14 (updates) = 15 lines'; + is scalar @rows, 18, '1 (header) + 17 (updates) = 18 lines'; is scalar @{$rows[0]}, 8, '8 columns present'; is_deeply $rows[0], -- cgit v1.2.3