From f54419d4ddd48beb9a959d933a75da773250190d Mon Sep 17 00:00:00 2001 From: Jeff Miccolis Date: Tue, 29 Mar 2016 15:17:46 -0400 Subject: [PATCH] Return first alternative in tests --- features/support/shared_steps.js | 6 ++++-- features/testbot/alternative_loop.feature | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/features/support/shared_steps.js b/features/support/shared_steps.js index c56ddf088..90ae95729 100644 --- a/features/support/shared_steps.js +++ b/features/support/shared_steps.js @@ -75,8 +75,10 @@ module.exports = function () { got.route = (instructions || '').trim(); if (headers.has('alternative')) { - got.alternative = json.found_alternative ? - this.wayList(json.alternative_instructions[0]) : ''; + // TODO examine more than first alternative? + got.alternative =''; + if (json.routes && json.routes.length > 1) + got.alternative = this.wayList(json.routes[1]); } var distance = hasRoute && json.routes[0].distance, diff --git a/features/testbot/alternative_loop.feature b/features/testbot/alternative_loop.feature index 6af2bfe0e..995009cd4 100644 --- a/features/testbot/alternative_loop.feature +++ b/features/testbot/alternative_loop.feature @@ -19,7 +19,7 @@ Feature: Alternative route | ca | yes | And the query options - | alt | true | + | alternative | true | When I route I should get | from | to | route | alternative |