aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-12-03 17:59:23 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-12-04 10:08:14 +0000
commit51cbde5ebcc08c52d3d5531c529c0c7a52b5e230 (patch)
treecc49b82f9c6b7e0a9fff52444b1665912cfe39b8 /t
parentbe3c0f5917fe1de5d87442f9341b033e3007c344 (diff)
Fix moderation without JavaScript.
Diffstat (limited to 't')
-rw-r--r--t/app/controller/moderate.t12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/app/controller/moderate.t b/t/app/controller/moderate.t
index a064a88d4..4eb72ed56 100644
--- a/t/app/controller/moderate.t
+++ b/t/app/controller/moderate.t
@@ -64,6 +64,9 @@ subtest 'Auth' => sub {
$mech->get_ok($REPORT_URL);
$mech->content_lacks('Moderat');
+ $mech->get_ok("$REPORT_URL/moderate");
+ $mech->content_lacks('Moderat');
+
$mech->log_in_ok( $user->email );
$mech->get_ok($REPORT_URL);
@@ -102,6 +105,9 @@ subtest 'Problem moderation' => sub {
subtest 'Post modify title and text' => sub {
$mech->get_ok($REPORT_URL);
+ $mech->content_lacks('show-moderation');
+ $mech->follow_link_ok({ text_regex => qr/^Moderate$/ });
+ $mech->content_contains('show-moderation');
$mech->submit_form_ok({ with_fields => {
%problem_prepopulated,
problem_title => 'Good good',
@@ -335,6 +341,9 @@ subtest 'updates' => sub {
subtest 'Update modify text' => sub {
$mech->get_ok($REPORT_URL);
+ $mech->content_lacks('show-moderation');
+ $mech->follow_link_ok({ text_regex => qr/^Moderate this update$/ });
+ $mech->content_contains('show-moderation');
$mech->submit_form_ok({ with_fields => {
%update_prepopulated,
update_text => 'update good good good',
@@ -446,6 +455,9 @@ subtest 'Now stop being a staff user' => sub {
$user->update({ from_body => undef });
$mech->get_ok($REPORT_URL);
$mech->content_contains('Moderated by Bromley Council');
+
+ $mech->get_ok("$REPORT_URL/moderate/" . $update->id);
+ $mech->content_lacks('Moderate this update');
};
subtest 'And do it as a superuser' => sub {