aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-02-08 11:22:20 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-02-11 17:02:25 +0000
commitfb65300cbf6fb9ca9ad077b12d44f188294d8005 (patch)
tree5bbdddfa69978576f39ad57aa9691624459f266f /t
parentd8d3da1119e41fd7a57a4664e92a644ba1a9c919 (diff)
[fixmystreet.com] Improve two-tier unresponsive.
Similarly to 1f69e28c, we were previously only checking the first matching entry, which led to confusing behaviour in places. Include consequential amendments for e.g. one body being unresponsive, the other not.
Diffstat (limited to 't')
-rw-r--r--t/app/controller/report_new.t6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index 66b802873..40264f073 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -1807,9 +1807,9 @@ subtest "unresponsive body handling works" => sub {
my $body_id = $contact1->body->id;
my $extra_details = $mech->get_ok_json('/report/new/ajax?latitude=55.952055&longitude=-3.189579');
like $extra_details->{top_message}, qr{Edinburgh.*accept reports.*/unresponsive\?body=$body_id};
- is $extra_details->{unresponsive}, $body_id, "unresponsive json set";
+ is_deeply $extra_details->{unresponsive}, { $body_id => 1 }, "unresponsive json set";
$extra_details = $mech->get_ok_json('/report/new/category_extras?category=Street%20lighting&latitude=55.952055&longitude=-3.189579');
- is $extra_details->{unresponsive}, $body_id, "unresponsive json set";
+ is_deeply $extra_details->{unresponsive}, { $body_id => 1 }, "unresponsive json set";
my $test_email = 'test-2@example.com';
$mech->log_out_ok;
@@ -1886,7 +1886,7 @@ subtest "unresponsive body handling works" => sub {
$extra_details = $mech->get_ok_json('/report/new/ajax?latitude=51.896268&longitude=-2.093063');
like $extra_details->{by_category}{$contact3->category}{category_extra}, qr/Cheltenham.*Trees.*unresponsive.*category=Trees/s;
$extra_details = $mech->get_ok_json('/report/new/category_extras?category=Trees&latitude=51.896268&longitude=-2.093063');
- is $extra_details->{unresponsive}, $contact3->body->id, "unresponsive json set";
+ is_deeply $extra_details->{unresponsive}, { $contact3->body->id => 1 }, "unresponsive json set";
$mech->get_ok('/around');
$mech->submit_form_ok( { with_fields => { pc => 'GL50 2PR', } }, "submit location" );