Return first alternative in tests
This commit is contained in:
		
							parent
							
								
									99c8c4e7cb
								
							
						
					
					
						commit
						f54419d4dd
					
				| @ -75,8 +75,10 @@ module.exports = function () { | |||||||
|                             got.route = (instructions || '').trim(); |                             got.route = (instructions || '').trim(); | ||||||
| 
 | 
 | ||||||
|                             if (headers.has('alternative')) { |                             if (headers.has('alternative')) { | ||||||
|                                 got.alternative = json.found_alternative ? |                                 // TODO examine more than first alternative?
 | ||||||
|                                     this.wayList(json.alternative_instructions[0]) : ''; |                                 got.alternative =''; | ||||||
|  |                                 if (json.routes && json.routes.length > 1) | ||||||
|  |                                     got.alternative = this.wayList(json.routes[1]); | ||||||
|                             } |                             } | ||||||
| 
 | 
 | ||||||
|                             var distance = hasRoute && json.routes[0].distance, |                             var distance = hasRoute && json.routes[0].distance, | ||||||
|  | |||||||
| @ -19,7 +19,7 @@ Feature: Alternative route | |||||||
|             | ca    | yes    | |             | ca    | yes    | | ||||||
| 
 | 
 | ||||||
|         And the query options |         And the query options | ||||||
|             | alt | true | |             | alternative | true | | ||||||
| 
 | 
 | ||||||
|         When I route I should get |         When I route I should get | ||||||
|             | from | to | route          | alternative | |             | from | to | route          | alternative | | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user