diff options
author | Steven Day <steve@mysociety.org> | 2015-08-12 17:42:41 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-02 13:34:54 +0100 |
commit | a344b99a0bf37134079afda51c6f963e1163904b (patch) | |
tree | 920bfa86c19113f9a2c99d401da885cea5e9f078 /t | |
parent | b002374a885736b7436fc1c3132e50b6a1f8bdf9 (diff) |
Allow cobrands to give extra parameters for pins.
So that you can build functionality to add extra limitations on
to the map pins displayed. Useful for Collideoscope initially
to filter out (or in) reports from the Department of Transport's
Stats19 Data.
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/around.t | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/t/app/controller/around.t b/t/app/controller/around.t index 618998513..8eaba6450 100644 --- a/t/app/controller/around.t +++ b/t/app/controller/around.t @@ -137,7 +137,7 @@ subtest 'check non public reports are not displayed on around page' => sub { }; -subtest 'check category and status filtering works on /around' => sub { +subtest 'check category, status and extra filtering works on /around' => sub { my $body = $mech->create_body_ok(2237, "Oxfordshire"); my $categories = [ 'Pothole', 'Vegetation', 'Flytipping' ]; @@ -157,6 +157,7 @@ subtest 'check category and status filtering works on /around' => sub { %$params, category => $category, state => $state, + external_body => "$category-$state", ); $mech->create_problems_for_body( 1, $body->id, 'Around page', \%report_params ); } @@ -185,6 +186,13 @@ subtest 'check category and status filtering works on /around' => sub { $json = $mech->get_ok_json( '/around?ajax=1&status=fixed&filter_category=Vegetation&bbox=' . $bbox ); $pins = $json->{pins}; is scalar @$pins, 1, 'correct number of fixed Vegetation reports'; + + my $cobrand = Test::MockModule->new('FixMyStreet::Cobrand::Default'); + $cobrand->mock('display_location_extra_params', sub { { external_body => "Pothole-fixed" } }); + + $json = $mech->get_ok_json( '/around?ajax=1&bbox=' . $bbox ); + $pins = $json->{pins}; + is scalar @$pins, 1, 'correct number of external_body reports'; }; subtest 'check skip_around skips around page' => sub { |