feat: include search lat/lng in station API meta response
This commit is contained in:
@@ -157,3 +157,17 @@ it('returns 422 when postcode cannot be resolved', function () {
|
||||
->assertUnprocessable()
|
||||
->assertJsonValidationErrors(['postcode']);
|
||||
});
|
||||
|
||||
it('includes resolved lat and lng in meta', function () {
|
||||
$station = Station::factory()->create(['lat' => 52.555064, 'lng' => -0.256119]);
|
||||
StationPriceCurrent::factory()->create([
|
||||
'station_id' => $station->node_id,
|
||||
'fuel_type' => FuelType::B7Standard,
|
||||
'price_pence' => 14500,
|
||||
]);
|
||||
|
||||
$this->getJson('/api/stations?lat=52.555064&lng=-0.256119&fuel_type=diesel&radius=10')
|
||||
->assertOk()
|
||||
->assertJsonPath('meta.lat', 52.555064)
|
||||
->assertJsonPath('meta.lng', -0.256119);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user