aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm1
-rw-r--r--perllib/FixMyStreet/Cobrand/Westminster.pm2
-rw-r--r--t/cobrand/westminster.t16
3 files changed, 19 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 53459baee..a19c43af8 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1554,6 +1554,7 @@ sub create_reporter_alert : Private {
my ( $self, $c ) = @_;
return if $c->stash->{no_reporter_alert};
+ return if $c->cobrand->call_hook('suppress_reporter_alerts');
my $problem = $c->stash->{report};
my $alert = $c->model('DB::Alert')->find_or_create( {
diff --git a/perllib/FixMyStreet/Cobrand/Westminster.pm b/perllib/FixMyStreet/Cobrand/Westminster.pm
index f5e52ae6d..76788d031 100644
--- a/perllib/FixMyStreet/Cobrand/Westminster.pm
+++ b/perllib/FixMyStreet/Cobrand/Westminster.pm
@@ -43,6 +43,8 @@ sub updates_disallowed {
return ( $staff || $superuser ) ? 0 : 1;
}
+sub suppress_reporter_alerts { 1 }
+
sub social_auth_enabled {
my $self = shift;
diff --git a/t/cobrand/westminster.t b/t/cobrand/westminster.t
index 83c796716..756b9720c 100644
--- a/t/cobrand/westminster.t
+++ b/t/cobrand/westminster.t
@@ -149,4 +149,20 @@ FixMyStreet::override_config {
};
};
+FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'westminster',
+ MAPIT_URL => 'http://mapit.uk/',
+}, sub {
+ subtest 'No reporter alert created' => sub {
+ my $user = $mech->log_in_ok('test@example.org');
+ $mech->get_ok('/');
+ $mech->submit_form_ok( { with_fields => { pc => 'SW1A1AA' } }, "submit location" );
+ $mech->follow_link_ok( { text_regex => qr/skip this step/i, }, "follow 'skip this step' link" );
+ $mech->submit_form_ok( { with_fields => {
+ title => 'Title', detail => 'Detail', category => 'Abandoned bike', name => 'Test Example',
+ } }, 'submitted okay' );
+ is $user->alerts->count, 0;
+ };
+};
+
done_testing();