diff options
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/bathnes.t | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/cobrand/bathnes.t b/t/cobrand/bathnes.t index 0a16fc96e..59e0d5246 100644 --- a/t/cobrand/bathnes.t +++ b/t/cobrand/bathnes.t @@ -191,6 +191,25 @@ subtest 'extra CSV columns are present if permission granted' => sub { is $rows[4]->[21], '', 'User phone number is correct'; is $rows[4]->[22], '', 'Staff User is empty if not made on behalf of another user'; is $rows[4]->[23], '', 'Attribute Data is correct'; + + $mech->get_ok('/dashboard?export=1&updates=1'); + + open $data_handle, '<', \$mech->content; + $csv = Text::CSV->new( { binary => 1 } ); + @rows = (); + while ( my $row = $csv->getline( $data_handle ) ) { + push @rows, $row; + } + + is scalar @rows, 1, '1 (header) + 0 (updates)'; + is scalar @{$rows[0]}, 10, '10 columns present'; + is_deeply $rows[0], + [ + 'Report ID', 'Update ID', 'Date', 'Status', 'Problem state', + 'Text', 'User Name', 'Reported As', 'Staff User', + 'User Email', + ], + 'Column headers look correct'; }; |