diff options
author | Dave Arter <davea@mysociety.org> | 2016-11-16 08:18:51 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-12-13 15:01:31 +0000 |
commit | 96bddb2ebda556eff5a79bbd31b936fbf6f1ef6b (patch) | |
tree | 17e3bfa0e1a1c1a2768648cdcb70cf77788679f3 /t | |
parent | dc151edce28d2e5bf873f8e86473a82b9c6f178a (diff) |
Add test for correct display of duplicate report
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/report_inspect.t | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t index efb32d116..9a62b1eb7 100644 --- a/t/app/controller/report_inspect.t +++ b/t/app/controller/report_inspect.t @@ -93,6 +93,25 @@ FixMyStreet::override_config { $mech->content_lacks('Invalid location'); }; + subtest "test duplicate report is shown" => sub { + my ($report2) = $mech->create_problems_for_body(1, $oxon->id, 'The other report is a duplicate of this one', { + category => $report->category, cobrand => 'fixmystreet', areas => ',2237,2420', + whensent => \'current_timestamp', + latitude => 51.847694, longitude => -1.355909, + }); + my $old_state = $report->state; + $report->set_extra_metadata('duplicate_of' => $report2->id); + $report->state('duplicate'); + $report->update; + + $mech->get_ok("/report/$report_id"); + $mech->content_contains($report2->title); + + $report->unset_extra_metadata('duplicate_of'); + $report->state($old_state); + $report->update; + }; + foreach my $test ( { type => 'report_edit_priority', priority => 1 }, { type => 'report_edit_category', category => 1 }, |