Skip to content

Commit

Permalink
Cucumber fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lev Dragunov committed Mar 4, 2019
1 parent 730d780 commit a305628
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 48 deletions.
4 changes: 4 additions & 0 deletions features/step_definitions/matching.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ module.exports = function () {
got.duration = duration.toString();
}

if (headers.has('data_version')) {
got.data_version = json.data_version || '';
}

// if header matches 'a:*', parse out the values for *
// and return in that header
headers.forEach((k) => {
Expand Down
31 changes: 5 additions & 26 deletions features/testbot/distance_matrix.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,11 @@ Feature: Basic Distance Matrix
| cf |

When I request a travel distance matrix I should get
| | a | b | e | f | data_version |
| a | 0 | 100.1 | 199.5 | 299.5 | |
| b | 100.1 | 0 | 99.4 | 199.5 | |
| e | 199.5 | 99.4 | 0 | 100.1 | |
| f | 299.5 | 199.5 | 100.1 | 0 | |

Scenario: Testbot - Data_version test at distance table
Given the node map
"""
a b c
d e f
"""

And the extract extra arguments "--data_version cucumber_data_version"

And the ways
| nodes |
| abc |
| def |
| ad |
| be |
| cf |

When I request a travel distance matrix I should get
| | a | b | e | f | data_version |
| a | 0 | 100.1 | 199.5 | 299.5 | cucumber_data_version |
| | a | b | e | f |
| a | 0 | 100.1 | 199.5 | 299.5 |
| b | 100.1 | 0 | 99.4 | 199.5 |
| e | 199.5 | 99.4 | 0 | 100.1 |
| f | 299.5 | 199.5 | 100.1 | 0 |

Scenario: Testbot - Travel distance matrix of minimal network exact distances
Given the node map
Expand Down
24 changes: 2 additions & 22 deletions features/testbot/trip.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,8 @@ Feature: Basic trip planning
| da |

When I plan a trip I should get
| waypoints | trips | data_version |
| a | aa | |

Scenario: Testbot - Trip: DataVersion
Given the node map
"""
a b
c d
"""

And the extract extra arguments "--data_version cucumber_data_version"

And the ways
| nodes |
| ab |
| bc |
| cb |
| da |

When I plan a trip I should get
| waypoints | trips | data_version |
| a | aa | cucumber_data_version |
| waypoints | trips |
| a | aa |

Scenario: Testbot - Trip: Roundtrip with waypoints (less than 10)
Given the node map
Expand Down

0 comments on commit a305628

Please sign in to comment.