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 |