aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-30 23:00:38 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-08-09 18:32:04 +0100
commit7145157c8e6d907b8f2aa71b483b2c1f88fac1ce (patch)
treeade3569240ac724f21f0cb0df93c5b06bfb1e5e9 /t/app/controller/admin.t
parent5633ecc489cef3cdc0e3e28a41973226a9d62c2d (diff)
allow flagging of user from report and update pages
Diffstat (limited to 't/app/controller/admin.t')
-rw-r--r--t/app/controller/admin.t39
1 files changed, 39 insertions, 0 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index 0c9f03fa6..2ccb2ea73 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -540,6 +540,25 @@ subtest 'adding email to abuse list from report page' => sub {
$mech->content_contains('<small>(Email in abuse table)</small>');
};
+subtest 'flagging user from report page' => sub {
+ $report->user->flagged(0);
+ $report->user->update;
+
+ $mech->get_ok( '/admin/report_edit/' . $report->id );
+ $mech->content_contains('Flag user');
+
+ $mech->click_ok('flaguser');
+
+ $mech->content_contains('User flagged');
+ $mech->content_contains('<small>(Flagged)</small>');
+
+ $report->discard_changes;
+ ok $report->user->flagged, 'user flagged';
+
+ $mech->get_ok( '/admin/report_edit/' . $report->id );
+ $mech->content_contains('<small>(Flagged)</small>');
+};
+
$log_entries->delete;
my $update = FixMyStreet::App->model('DB::Comment')->create(
@@ -741,6 +760,26 @@ subtest 'adding email to abuse list from update page' => sub {
$mech->content_contains('<small>(Email in abuse table)</small>');
};
+subtest 'flagging user from update page' => sub {
+ $update->user->flagged(0);
+ $update->user->update;
+
+ $mech->get_ok( '/admin/update_edit/' . $update->id );
+ $mech->content_contains('Flag user');
+
+ $mech->click_ok('flaguser');
+
+ $mech->content_contains('User flagged');
+ $mech->content_contains('<small>(Flagged)</small>');
+
+ $update->discard_changes;
+ ok $update->user->flagged, 'user flagged';
+
+ $mech->get_ok( '/admin/update_edit/' . $update->id );
+ $mech->content_contains('<small>(Flagged)</small>');
+};
+
+
subtest 'hiding comment marked as fixed reopens report' => sub {
$update->mark_fixed( 1 );
$update->update;