aboutsummaryrefslogtreecommitdiffstats
path: root/t/Mock/Tilma.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-04-08 11:23:47 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-04-08 12:11:35 +0100
commit3e437b5a5a3e27100473f095e91d8d6637f2a027 (patch)
tree2f4e5659bca4f581b9860f45e3c9ea01c41d0e9b /t/Mock/Tilma.pm
parentf87830f26d1699e0ed07560893d7b7938b5a5266 (diff)
[TfL] Restrict HE categories to HE roads.
The checks added in 285e183db missed the TfL cobrand.
Diffstat (limited to 't/Mock/Tilma.pm')
-rw-r--r--t/Mock/Tilma.pm27
1 files changed, 20 insertions, 7 deletions
diff --git a/t/Mock/Tilma.pm b/t/Mock/Tilma.pm
index 5a11209e3..7542b1f5e 100644
--- a/t/Mock/Tilma.pm
+++ b/t/Mock/Tilma.pm
@@ -10,6 +10,18 @@ has json => (
},
);
+sub as_json {
+ my ($self, $features) = @_;
+ my $json = mySociety::Locale::in_gb_locale {
+ $self->json->encode({
+ type => "FeatureCollection",
+ crs => { type => "name", properties => { name => "urn:ogc:def:crs:EPSG::27700" } },
+ features => $features,
+ });
+ };
+ return $json;
+}
+
sub dispatch_request {
my $self = shift;
@@ -25,15 +37,16 @@ sub dispatch_request {
[ 539408.94, 170607.58 ],
] ] } } ];
}
- my $json = mySociety::Locale::in_gb_locale {
- $self->json->encode({
- type => "FeatureCollection",
- crs => { type => "name", properties => { name => "urn:ogc:def:crs:EPSG::27700" } },
- features => $features,
- });
- };
+ my $json = $self->as_json($features);
return [ 200, [ 'Content-Type' => 'application/json' ], [ $json ] ];
},
+
+ sub (GET + /mapserver/highways + ?*) {
+ my ($self, $args) = @_;
+ my $json = $self->as_json([]);
+ return [ 200, [ 'Content-Type' => 'application/json' ], [ $json ] ];
+ },
+
}
__PACKAGE__->run_if_script;