aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/cobrand/tfl.t19
1 files changed, 14 insertions, 5 deletions
diff --git a/t/cobrand/tfl.t b/t/cobrand/tfl.t
index 0346ee2b7..4ae21cdaa 100644
--- a/t/cobrand/tfl.t
+++ b/t/cobrand/tfl.t
@@ -31,6 +31,11 @@ my $contact1 = $mech->create_contact_ok(
email => 'busstops@example.com',
);
$contact1->set_extra_metadata(group => [ 'Bus things' ]);
+$contact1->set_extra_fields({
+ code => 'leaning',
+ description => 'Is the pole leaning?',
+ datatype => 'string',
+});
$contact1->update;
my $contact2 = $mech->create_contact_ok(
body_id => $body->id,
@@ -179,16 +184,20 @@ subtest "reference number included in email" => sub {
$mech->content_contains('FMS' . $report->id) or diag $mech->content;
};
-subtest 'Dashboard extra columns' => sub {
+subtest 'Dashboard CSV extra columns' => sub {
+ my $report = FixMyStreet::DB->resultset("Problem")->find({ title => 'Test Report 1'});
+ $report->set_extra_fields({ name => 'leaning', value => 'Yes' });
+ $report->update;
+
$mech->log_in_ok( $staffuser->email );
- $mech->get_ok('/dashboard?export=1');
+ $mech->get_ok('/dashboard?export=1&category=Bus+stops');
$mech->content_contains('Category,Subcategory');
$mech->content_contains('Query,Borough');
- $mech->content_contains(',"Safety critical","Delivered to","Closure email at","Reassigned at","Reassigned by"');
+ $mech->content_contains(',"Safety critical","Delivered to","Closure email at","Reassigned at","Reassigned by","Is the pole leaning?"');
$mech->content_contains('"Bus things","Bus stops"');
$mech->content_contains('"BR1 3UH",Bromley,');
- $mech->content_contains(',,,no');
- my $report = FixMyStreet::DB->resultset("Problem")->find({ title => 'Test Report 1'});
+ $mech->content_contains(',,,no,busstops@example.com,,,,Yes');
+
$report->set_extra_fields({ name => 'safety_critical', value => 'yes' });
$report->anonymous(1);
$report->update;