version check for the trip plugin

This commit is contained in:
Lev Dragunov 2019-07-31 15:50:14 +03:00
parent f2946163d6
commit 977e2f0337
2 changed files with 47 additions and 5 deletions

View File

@ -43,6 +43,10 @@ module.exports = function () {
got.message = json.message;
}
if (headers.has('data_version')) {
got.data_version = json.data_version || '';
}
if (headers.has('geometry')) {
if (this.queryParams['geometries'] === 'polyline') {
got.geometry = polyline.decode(json.trips[0].geometry).toString();

View File

@ -5,6 +5,24 @@ Feature: Basic trip planning
Given the profile "testbot"
Given a grid size of 10 meters
Scenario: Testbot - Trip: Invalid options (like was in test suite for a long time)
Given the node map
"""
a b
c d
"""
And the ways
| nodes |
| ab |
| bc |
| cb |
| da |
When I plan a trip I should get
| waypoints | trips | code |
| a | aa | InvalidOptions |
Scenario: Testbot - Trip: Roundtrip with one waypoint
Given the node map
"""
@ -20,8 +38,28 @@ Feature: Basic trip planning
| da |
When I plan a trip I should get
| waypoints | trips |
| a | aa |
| waypoints | trips | code |
| a,a | aa | Ok |
Scenario: Testbot - Trip: data version check
Given the node map
"""
a b
c d
"""
And the ways
| nodes |
| ab |
| bc |
| cb |
| da |
And the extract extra arguments "--data_version cucumber_data_version"
When I plan a trip I should get
| waypoints | trips | data_version | code |
| a,a | aa | cucumber_data_version | Ok |
Scenario: Testbot - Trip: Roundtrip with waypoints (less than 10)
Given the node map
@ -38,9 +76,9 @@ Feature: Basic trip planning
| da |
When I plan a trip I should get
| waypoints | trips | durations |
| a,b,c,d | abcda | 7.6 |
| d,b,c,a | dbcad | 7.6 |
| waypoints | trips | durations | code |
| a,b,c,d | abcda | 7.6 | Ok |
| d,b,c,a | dbcad | 7.6 | Ok |
Scenario: Testbot - Trip: Roundtrip waypoints (more than 10)
Given the node map