diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2014-03-06 16:04:11 +0000 |
---|---|---|
committer | Hakim Cassimally <hakim@mysociety.org> | 2014-03-10 15:28:19 +0000 |
commit | 2825102c58448e15dc5323396d93f84f1bd3eb6b (patch) | |
tree | 2922ec545eb5f013fb69c45d07c8e39ff2f5155d /t/app/controller | |
parent | f6340aba0c9819756d2298c58aec6c79c877ee70 (diff) |
Export reports as CSV on /dashboard
Provide a button to download the details and text of reports
at the second "Look up" button on /dashboard.
Provides acknowledged, fixed, closed dates by parsing updates.
Fixes #692 (and mysociety/FixMyStreet-Commercial#399)
Email is not shown, and name honours anonymous flag: as /dashboard
is accessible to people who are from_body (who still do not see
anon-users name and email in the FMS web app.)
A basic test is provided as per Zurich's similar report.
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/dashboard.t | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t index fa94097a7..5e4b4cbeb 100644 --- a/t/app/controller/dashboard.t +++ b/t/app/controller/dashboard.t @@ -602,8 +602,15 @@ FixMyStreet::override_config { check_report_counts( $res, $test->{report_counts_after} ); }; } + + subtest 'export as csv' => sub { + $mech->get_ok('/dashboard?export=1'); + my @lines = split /\n/, $mech->content; + is scalar @lines, 6, '1 (header) + 5 (reports) = 6 lines'; + }; }; + sub make_problem { my $args = shift; |