Refactor alternative route test

This commit is contained in:
Freenerd
2015-09-22 11:46:00 +02:00
committed by Patrick Niklaus
parent 9deadc1371
commit 55cad1b3ac
3 changed files with 44 additions and 26 deletions
+6 -2
View File
@@ -83,8 +83,12 @@ When /^I route I should get$/ do |table|
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
got['alternative'] =
if json['found_alternative']
way_list json['alternative_instructions'].first
else
""
end
end
if table.headers.include?('distance')
if row['distance']!=''