aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-01-08 15:55:48 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-01-09 17:31:44 +0000
commita47cdf03631855fd83866b932161eaa8ccf0c8b5 (patch)
tree8589ba85501132a7eb14fb75e78eabe37503882d /t
parentc38ca476d282c8e369ae6788b3400c4cc41f3e20 (diff)
[Inactive] Add option to fully delete reports.
Diffstat (limited to 't')
-rw-r--r--t/script/inactive.t11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/script/inactive.t b/t/script/inactive.t
index 60cf3ecb5..582059cbf 100644
--- a/t/script/inactive.t
+++ b/t/script/inactive.t
@@ -60,6 +60,17 @@ subtest 'Closing updates on inactive fixed/closed reports' => sub {
$mech->content_contains('now closed to updates');
};
+subtest 'Deleting reports' => sub {
+ my $in = FixMyStreet::Script::Inactive->new( delete => 6 );
+ $in->reports;
+
+ my $count = FixMyStreet::DB->resultset("Problem")->count;
+ is $count, 6, 'Six left';
+
+ $mech->get("/report/" . $problems[2]->id);
+ is $mech->res->code, 404;
+};
+
subtest 'Anonymization of inactive users' => sub {
my $in = FixMyStreet::Script::Inactive->new( anonymize => 6, email => 3, verbose => 1 );
stdout_is { $in->users } "Anonymizing user #" . $user->id . "\nEmailing user #" . $user_inactive->id . "\n", 'users dealt with first time';