aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/model
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2016-12-16 15:02:53 +0100
committerMarius Halden <marius.h@lden.org>2016-12-16 15:02:53 +0100
commitdbf56159e44c1560a413022451bf1a1c4cb22a52 (patch)
tree275599a1894ca48d8dbf3c2843064c3dbf4affc7 /t/app/model
parenta1603b96cae9258761f8cc59d76e0512f49afc3d (diff)
parent38490f6ea18064c232bda6ebfbaee052bd8f0951 (diff)
Merge tag 'v2.0.1' into fiksgatami-dev-v2
Diffstat (limited to 't/app/model')
-rw-r--r--t/app/model/problem.t11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/app/model/problem.t b/t/app/model/problem.t
index bd7d0e55c..1130078c0 100644
--- a/t/app/model/problem.t
+++ b/t/app/model/problem.t
@@ -763,6 +763,17 @@ subtest 'check response templates' => sub {
is $problem->response_templates, 2, 'Global and pothole templates returned';
};
+subtest 'check duplicate reports' => sub {
+ my ($problem1, $problem2) = $mech->create_problems_for_body(2, $body_ids{2651}, 'TITLE');
+ $problem1->set_extra_metadata(duplicate_of => $problem2->id);
+ $problem1->state('duplicate');
+ $problem1->update;
+
+ is $problem1->duplicate_of->title, $problem2->title, 'problem1 returns correct problem from duplicate_of';
+ is scalar @{ $problem2->duplicates }, 1, 'problem2 has correct number of duplicates';
+ is $problem2->duplicates->[0]->title, $problem1->title, 'problem2 includes problem1 in duplicates';
+};
+
END {
$problem->comments->delete if $problem;
$problem->delete if $problem;