diff options
Diffstat (limited to 't')
-rw-r--r-- | t/cobrand/northamptonshire.t | 1 | ||||
-rw-r--r-- | t/cobrand/oxfordshire.t | 29 | ||||
-rw-r--r-- | t/cobrand/peterborough.t | 2 |
3 files changed, 32 insertions, 0 deletions
diff --git a/t/cobrand/northamptonshire.t b/t/cobrand/northamptonshire.t index 70df10340..57fe319a9 100644 --- a/t/cobrand/northamptonshire.t +++ b/t/cobrand/northamptonshire.t @@ -83,6 +83,7 @@ subtest 'Check updates not sent for defects' => sub { }; $report->update({ user => $user }); +$comment->update({ extra => undef }); subtest 'check updates sent for non defects' => sub { FixMyStreet::override_config { ALLOWED_COBRANDS => [ { northamptonshire => '.' } ], 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(); } diff --git a/t/cobrand/peterborough.t b/t/cobrand/peterborough.t index d61b3de75..5d07acb9f 100644 --- a/t/cobrand/peterborough.t +++ b/t/cobrand/peterborough.t @@ -25,6 +25,7 @@ subtest 'open311 request handling', sub { $p->push_extra_fields({ name => 'emergency', value => 'no'}); $p->push_extra_fields({ name => 'private_land', value => 'no'}); $p->push_extra_fields({ name => 'PCC-light', value => 'whatever'}); + $p->push_extra_fields({ name => 'PCC-skanska-csc-ref', value => '1234'}); $p->push_extra_fields({ name => 'tree_code', value => 'tree-42'}); $p->update; @@ -38,6 +39,7 @@ subtest 'open311 request handling', sub { my $req = $test_data->{test_req_used}; my $c = CGI::Simple->new($req->content); + is $c->param('attribute[description]'), "Title Test 1 for " . $peterborough->id . " Detail\r\n\r\nSkanska CSC ref: 1234", 'Ref added to description'; is $c->param('attribute[emergency]'), undef, 'no emergency param sent'; is $c->param('attribute[private_land]'), undef, 'no private_land param sent'; is $c->param('attribute[PCC-light]'), undef, 'no pcc- param sent'; |