aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-09-10 14:49:30 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-09-13 08:33:24 +0100
commitf2a5d899308634fb06605a1d8035e19eadb8932a (patch)
treefe7ecbb80f9699ca8a26eef8dca63acaabf7938f /t
parent42bbac994c625e24a6eb645de9c47a7dd2b226ef (diff)
Add cobrand hook for disallowing title moderation.
Diffstat (limited to 't')
-rw-r--r--t/app/controller/moderate.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/app/controller/moderate.t b/t/app/controller/moderate.t
index c2ac3ad5a..c3aba0ebb 100644
--- a/t/app/controller/moderate.t
+++ b/t/app/controller/moderate.t
@@ -4,6 +4,12 @@ use parent 'FixMyStreet::Cobrand::Default';
sub send_moderation_notifications { 0 }
+package FixMyStreet::Cobrand::TestTitle;
+
+use parent 'FixMyStreet::Cobrand::Default';
+
+sub moderate_permission_title { 0 }
+
package main;
use FixMyStreet::TestMech;
@@ -208,6 +214,25 @@ subtest 'Problem moderation' => sub {
$report->update({ state => 'confirmed' });
}
};
+
+ subtest 'Try and moderate title when not allowed' => sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => 'testtitle'
+ }, sub {
+ $mech->get_ok($REPORT_URL);
+ $mech->submit_form_ok({ with_fields => {
+ problem_show_name => 1,
+ problem_photo => 1,
+ problem_detail => 'Changed detail',
+ }});
+ $mech->base_like( qr{\Q$REPORT_URL\E} );
+ $mech->content_like(qr/Moderated by Bromley Council/);
+
+ $report->discard_changes;
+ is $report->title, 'Good bad good';
+ is $report->detail, 'Changed detail';
+ }
+ };
};
$mech->content_lacks('Posted anonymously', 'sanity check');