From 7b2b0132c372fb840d3d1e130ce9a66fbb9ee75b Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 9 Jan 2019 16:41:55 +0000 Subject: Allow override search to /report/new => /around. This is so you can have a search box on an around page (wrapped in a form going to /report/new) to start a new search, ignoring the lat/lon that will also be submitted. --- t/app/controller/report_new.t | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 't/app/controller') diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index b796578a0..8290faac0 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -24,10 +24,15 @@ subtest "test that bare requests to /report/new get redirected" => sub { MAPIT_URL => 'http://mapit.uk/', }, sub { $mech->get_ok('/report/new?pc=SW1A%201AA'); + is $mech->uri->path, '/around', "went to /around"; + is_deeply { $mech->uri->query_form }, { pc => 'SW1A 1AA' }, + "pc correctly transferred"; + + $mech->get_ok('/report/new?pc_override=SW1A%201AA&latitude=51&longitude=-2'); + is $mech->uri->path, '/around', "went to /around"; + is_deeply { $mech->uri->query_form }, { pc => 'SW1A 1AA' }, + "pc correctly transferred, lat/lon gone"; }; - is $mech->uri->path, '/around', "went to /around"; - is_deeply { $mech->uri->query_form }, { pc => 'SW1A 1AA' }, - "pc correctly transferred"; }; my %body_ids; -- cgit v1.2.3