aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-10-13 17:49:04 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-10-13 17:49:04 +0100
commit8ab9812e6cd5f686f7ab4d9a9859e8be4456ccd0 (patch)
tree5bf1a9d25d2707a70c023a8aa53cf01cbe2f8d71 /t/app
parent9fc69a31cda118948e3714bc7f4fff9d0a3ca84e (diff)
parentb86c2142d2f82fb503807feae0a8df4b8af39571 (diff)
Merge branch 'issues/forcouncils/86-show-shortlist-reports'
Diffstat (limited to 't/app')
-rw-r--r--t/app/model/user_planned_report.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/app/model/user_planned_report.t b/t/app/model/user_planned_report.t
index 6c0823044..95a76615e 100644
--- a/t/app/model/user_planned_report.t
+++ b/t/app/model/user_planned_report.t
@@ -11,6 +11,7 @@ my $mech = FixMyStreet::TestMech->new();
my @problems = $mech->create_problems_for_body(1, 2237, 'Title');
my $problem = $problems[0];
my $user = $problem->user;
+my $user2 = $mech->create_user_ok('other@example.net');
is $user->active_planned_reports, 0;
is $user->planned_reports, 0;
@@ -19,6 +20,10 @@ $user->add_to_planned_reports($problem);
is $user->active_planned_reports, 1;
is $user->planned_reports, 1;
+$user->add_to_planned_reports($problem);
+is $user->active_planned_reports, 1;
+is $user->planned_reports, 1;
+
$user->remove_from_planned_reports($problem);
is $user->active_planned_reports, 0;
is $user->planned_reports, 1;
@@ -27,8 +32,21 @@ $user->add_to_planned_reports($problem);
is $user->active_planned_reports, 1;
is $user->planned_reports, 2;
+$user2->add_to_planned_reports($problem);
+is $user->active_planned_reports, 0;
+is $user->planned_reports, 2;
+is $user2->active_planned_reports, 1;
+is $user2->planned_reports, 1;
+
+$user->add_to_planned_reports($problem);
+is $user->active_planned_reports, 1;
+is $user->planned_reports, 3;
+is $user2->active_planned_reports, 0;
+is $user2->planned_reports, 1;
+
done_testing();
END {
$mech->delete_user($user);
+ $mech->delete_user($user2);
}