Add a summary to each match result showing distance and duration.

Helpful for comparing how long the routing engine thinks the matched
trace should take to travel.
This commit is contained in:
Daniel Patterson
2015-11-13 17:57:07 -05:00
parent d5e4495f89
commit c7e30e2266
3 changed files with 46 additions and 1 deletions
+4
View File
@@ -156,6 +156,7 @@ When /^I match with turns I should get$/ do |table|
modes = mode_list json['matchings'][0]['instructions']
times = time_list json['matchings'][0]['instructions']
distances = distance_list json['matchings'][0]['instructions']
summary = json['matchings'][0]['route_summary']
end
end
@@ -168,6 +169,9 @@ When /^I match with turns I should get$/ do |table|
if table.headers.include? '#' # comment column
got['#'] = row['#'] # copy value so it always match
end
if table.headers.include? 'duration'
got['duration'] = "#{summary["total_time"]}"
end
sub_matchings = []
if response.code == "200"