aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2020-04-29 10:14:05 +0100
committerDave Arter <davea@mysociety.org>2020-04-29 12:53:00 +0100
commitfaad588069c2db225a46c2ad6de749b65232f6f7 (patch)
tree0c339f3cb123574f9f61214e030cca3f63bb9de2 /t
parent13e9cbb95d6ba619c4046bbbdcd7e7cb7b0f9e67 (diff)
[Oxfordshire] Include external problem reference in CSV export
For https://github.com/mysociety/fixmystreet-commercial/issues/1876
Diffstat (limited to 't')
-rw-r--r--t/cobrand/oxfordshire.t29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/cobrand/oxfordshire.t b/t/cobrand/oxfordshire.t
index dd5eedc8d..907c66c19 100644
--- a/t/cobrand/oxfordshire.t
+++ b/t/cobrand/oxfordshire.t
@@ -5,6 +5,7 @@ use FixMyStreet::Script::Alerts;
my $mech = FixMyStreet::TestMech->new;
my $oxon = $mech->create_body_ok(2237, 'Oxfordshire County Council');
+my $counciluser = $mech->create_user_ok('counciluser@example.com', name => 'Council User', from_body => $oxon);
subtest 'check /around?ajax defaults to open reports only' => sub {
my $categories = [ 'Bridges', 'Fences', 'Manhole' ];
@@ -105,6 +106,34 @@ subtest 'check unable to fix label' => sub {
};
};
+subtest 'extra CSV columns are present' => sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'oxfordshire' ],
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+
+ $mech->log_in_ok( $counciluser->email );
+
+ $mech->get_ok('/dashboard?export=1');
+
+ my @rows = $mech->content_as_csv;
+ is scalar @rows, 7, '1 (header) + 6 (reports) = 7 lines';
+ is scalar @{$rows[0]}, 21, '21 columns present';
+
+ is_deeply $rows[0],
+ [
+ 'Report ID', 'Title', 'Detail', 'User Name', 'Category',
+ 'Created', 'Confirmed', 'Acknowledged', 'Fixed', 'Closed',
+ 'Status', 'Latitude', 'Longitude', 'Query', 'Ward',
+ 'Easting', 'Northing', 'Report URL', 'Site Used',
+ 'Reported As', 'HIAMS Ref',
+ ],
+ 'Column headers look correct';
+
+ is $rows[1]->[20], 'ENQ12456', 'HIAMS reference included in row';
+ };
+};
+
END {
done_testing();
}