diff options
author | Struan Donald <struan@exo.org.uk> | 2017-09-20 15:40:14 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2017-09-28 12:33:25 +0100 |
commit | 22acc7613cad96477689023a97827c72f9da872d (patch) | |
tree | b46fa0fe72a6a6f14412f776d6c9a350d603df1d /t/app/controller | |
parent | 8890888e59ac83e503de4f19a6d84aabaf62aa20 (diff) |
show nearest address for report in inspector panel
If we've stored the nearest address then display that at the top of the
inspector panel.
Fixes mysociety/fixmystreetforcouncils#234
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/report_inspect.t | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t index fb18526ac..45bb4f8a7 100644 --- a/t/app/controller/report_inspect.t +++ b/t/app/controller/report_inspect.t @@ -261,6 +261,43 @@ FixMyStreet::override_config { }); }; } + + subtest "check nearest address display" => sub { + $mech->get_ok("/report/$report_id"); + $mech->content_lacks('Nearest calculated address', 'No address displayed'); + + my $data = { + resourceSets => [ { + resources => [ { + address => { + addressLine => 'Constitution Hill', + locality => 'London', + } + } ], + } ], + }; + $report->geocode($data); + $report->update; + $mech->get_ok("/report/$report_id"); + $mech->content_lacks('Nearest calculated address', 'No address displayed'); + + $data = { + resourceSets => [ { + resources => [ { + name => 'Constitution Hill, London, SW1A', + address => { + addressLine => 'Constitution Hill', + locality => 'London', + } + } ], + } ], + }; + $report->geocode($data); + $report->update; + $mech->get_ok("/report/$report_id"); + $mech->content_contains('Nearest calculated address', 'Address displayed'); + $mech->content_contains('Constitution Hill, London, SW1A', 'Correct address displayed'); + } }; foreach my $test ( |