Skip to content

Commit

Permalink
version check for the trip plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Dragunov committed Aug 2, 2019
1 parent f294616 commit 977e2f0
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 5 deletions.
4 changes: 4 additions & 0 deletions features/step_definitions/trip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
48 changes: 43 additions & 5 deletions features/testbot/trip.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 977e2f0

Please sign in to comment.