Use .round instead of .to_i for cucumber speeds

This commit is contained in:
Lauren Budorick
2015-08-21 19:01:24 -07:00
committed by Patrick Niklaus
parent 2b5aa142fb
commit 0a53dccd4c
5 changed files with 9 additions and 10 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ When /^I route I should get$/ do |table|
raise "*** Speed must be specied in km/h. (ex: 50 km/h)" unless row['speed'] =~ /\d+ km\/h/
time = json['route_summary']['total_time']
distance = json['route_summary']['total_distance']
speed = time>0 ? (3.6*distance/time).to_i : nil
speed = time>0 ? (3.6*distance/time).round : nil
got['speed'] = "#{speed} km/h"
else
got['speed'] = ''