aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-09-11 17:55:35 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-10-25 14:07:13 +0100
commitd317d22e88266acba0eb7eff41a0d8528239c8e0 (patch)
treece89b4e37c15805eb90039d9a9051b5dfa0e7307 /t/cobrand
parent1016181d70363325e989c0ec8598341ec1f34ec6 (diff)
[BANES] Override category display name.
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/bathnes.t18
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 );