Test that alternative route exists

Complement to a6b44a1470
This commit is contained in:
Freenerd
2015-09-18 17:30:53 +02:00
parent a6b44a1470
commit e1ac1c4fdc
2 changed files with 29 additions and 0 deletions
+4
View File
@@ -82,6 +82,10 @@ When /^I route I should get$/ do |table|
end
if table.headers.include? 'route'
got['route'] = (instructions || '').strip
if table.headers.include?('alternative')
raise "*** No alternative found ***" unless json['found_alternative']
got['alternative'] = way_list json['alternative_instructions'].first
end
if table.headers.include?('distance')
if row['distance']!=''
raise "*** Distance must be specied in meters. (ex: 250m)" unless row['distance'] =~ /\d+m/