diff options
Diffstat (limited to 't')
-rw-r--r-- | t/cobrand/bathnes.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/cobrand/bathnes.t b/t/cobrand/bathnes.t index d434d1160..42a8ffe93 100644 --- a/t/cobrand/bathnes.t +++ b/t/cobrand/bathnes.t @@ -1,6 +1,10 @@ +use Test::MockModule; use FixMyStreet::TestMech; my $mech = FixMyStreet::TestMech->new; +my $cobrand = Test::MockModule->new('FixMyStreet::Cobrand::BathNES'); +$cobrand->mock('area_types', sub { [ 'UTA' ] }); + my $body = $mech->create_body_ok(2551, 'Bath and North East Somerset Council'); my @cats = ('Litter', 'Other', 'Potholes', 'Traffic lights'); for my $contact ( @cats ) { @@ -59,6 +63,20 @@ subtest 'cobrand displays council name' => sub { $mech->content_like( qr/Bath and North East Somerset\b/ ); }; +subtest 'check override contact display name' => sub { + $mech->log_in_ok( $superuser->email ); + $mech->get_ok("/admin/body/" . $body->id . '/Litter'); + $mech->content_contains('<h1>Litter</h1>'); + $mech->content_contains('extra[display_name]'); + $mech->submit_form_ok({ with_fields => { + 'extra[display_name]' => 'Wittering' + }}); + $mech->get_ok('/reports/Bath+and+North+East+Somerset'); + $mech->content_contains('Wittering</option>'); + $mech->content_contains('value="Litter"'); + $mech->content_lacks('Litter</option>'); +}; + subtest 'extra CSV columns are absent if permission not granted' => sub { $mech->log_in_ok( $counciluser->email ); |