From 4c0328bbe43b5cdf0ca9660505220d093a0cebe0 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Mon, 4 Sep 2017 17:04:49 +0100 Subject: include ward in dashboard csv export Adds a Ward column to the council dashboard CSV export with the name of the ward. Fixes mysociety/fixmystreetforcouncils#220 --- t/app/controller/dashboard.t | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 't/app/controller/dashboard.t') diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t index b87b58b38..4ecad9f31 100644 --- a/t/app/controller/dashboard.t +++ b/t/app/controller/dashboard.t @@ -593,6 +593,7 @@ FixMyStreet::override_config { detail => "this report\nis split across\nseveral lines", state => "confirmed", conf_dt => DateTime->now(), + areas => 62883, } ); $mech->get_ok('/dashboard?export=1'); open my $data_handle, '<', \$mech->content; @@ -602,6 +603,31 @@ FixMyStreet::override_config { push @rows, $row; } is scalar @rows, 6, '1 (header) + 5 (reports) = 6 lines'; + + is scalar @{$rows[0]}, 16, '16 columns present'; + + is_deeply $rows[0], + [ + 'Report ID', + 'Title', + 'Detail', + 'User Name', + 'Category', + 'Created', + 'Confirmed', + 'Acknowledged', + 'Fixed', + 'Closed', + 'Status', + 'Latitude', + 'Longitude', + 'Nearest Postcode', + 'Ward', + 'Report URL', + ], + 'Column headers look correct'; + + is $rows[5]->[14], 'Bradford-on-Avon', 'Ward column is name not ID'; }; }; restore_time; -- cgit v1.2.3 From 1391186c2fb56e46df5b124362e3facf6af173b5 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Mon, 4 Sep 2017 17:47:46 +0100 Subject: include easting/northing in dashboard CSV export Fixes mysociety/fixmystreetforcouncils#221 --- t/app/controller/dashboard.t | 7 ++++++- 1 file changed, 6 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 4ecad9f31..5c0e19070 100644 --- a/t/app/controller/dashboard.t +++ b/t/app/controller/dashboard.t @@ -604,7 +604,7 @@ FixMyStreet::override_config { } is scalar @rows, 6, '1 (header) + 5 (reports) = 6 lines'; - is scalar @{$rows[0]}, 16, '16 columns present'; + is scalar @{$rows[0]}, 18, '18 columns present'; is_deeply $rows[0], [ @@ -623,11 +623,16 @@ FixMyStreet::override_config { 'Longitude', 'Nearest Postcode', 'Ward', + 'Easting', + 'Northing', 'Report URL', ], 'Column headers look correct'; is $rows[5]->[14], 'Bradford-on-Avon', 'Ward column is name not ID'; + + is $rows[5]->[15], '610591', 'Correct Easting conversion'; + is $rows[5]->[16], '126573', 'Correct Northing conversion'; }; }; restore_time; -- cgit v1.2.3