aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/app/controller/dashboard.t16
-rw-r--r--t/cobrand/zurich.t4
2 files changed, 16 insertions, 4 deletions
diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t
index a87232e9b..4e62028b5 100644
--- a/t/app/controller/dashboard.t
+++ b/t/app/controller/dashboard.t
@@ -609,9 +609,19 @@ FixMyStreet::override_config {
}
subtest 'export as csv' => sub {
+ make_problem( {
+ detail => "this report\nis split across\nseveral lines",
+ state => "confirmed",
+ conf_dt => DateTime->now(),
+ } );
$mech->get_ok('/dashboard?export=1');
- my @lines = split /\n/, $mech->content;
- is scalar @lines, 6, '1 (header) + 5 (reports) = 6 lines';
+ open my $data_handle, '<', \$mech->content;
+ my $csv = Text::CSV->new( { binary => 1 } );
+ my @rows;
+ while ( my $row = $csv->getline( $data_handle ) ) {
+ push @rows, $row;
+ }
+ is scalar @rows, 7, '1 (header) + 6 (reports) = 7 lines';
};
};
restore_time;
@@ -623,7 +633,7 @@ sub make_problem {
title => 'a problem',
name => 'a user',
anonymous => 1,
- detail => 'some detail',
+ detail => $args->{detail} || 'some detail',
state => $args->{state},
confirmed => $args->{conf_dt},
whensent => $args->{conf_dt},
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t
index e97891b91..16c0b77f8 100644
--- a/t/cobrand/zurich.t
+++ b/t/cobrand/zurich.t
@@ -565,7 +565,8 @@ subtest "phone number is mandatory" => sub {
MAPIT_TYPES => [ 'O08' ],
MAPIT_URL => 'http://global.mapit.mysociety.org/',
ALLOWED_COBRANDS => [ 'zurich' ],
- MAPIT_ID_WHITELIST => [ 423017 ],
+ MAPIT_ID_WHITELIST => [ 274456 ],
+ MAPIT_GENERATION => 2,
}, sub {
$user = $mech->log_in_ok( 'dm1@example.org' );
$mech->get_ok( '/report/new?lat=47.381817&lon=8.529156' );
@@ -581,6 +582,7 @@ subtest "phone number is not mandatory for reports from mobile apps" => sub {
MAPIT_URL => 'http://global.mapit.mysociety.org/',
ALLOWED_COBRANDS => [ 'zurich' ],
MAPIT_ID_WHITELIST => [ 423017 ],
+ MAPIT_GENERATION => 4,
}, sub {
$mech->post_ok( '/report/new/mobile?lat=47.381817&lon=8.529156' , {
service => 'iPhone',