From a5bfcd876f601861958f0b4955f35292b45373cf Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Tue, 9 May 2017 15:56:30 +0200 Subject: [PATCH] Add response code to test result values --- features/step_definitions/matching.js | 5 ++++- features/support/shared_steps.js | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/features/step_definitions/matching.js b/features/step_definitions/matching.js index 4b3b96cb0..ef66d7b3c 100644 --- a/features/step_definitions/matching.js +++ b/features/step_definitions/matching.js @@ -16,10 +16,13 @@ module.exports = function () { var headers = new Set(table.raw()[0]); + got.code = 'unknown'; if (res.body.length) { json = JSON.parse(res.body); + got.code = json.code; } + if (headers.has('status')) { got.status = json.status.toString(); } @@ -33,7 +36,7 @@ module.exports = function () { got['#'] = row['#']; } - var subMatchings = [], + var subMatchings = [''], turns = '', route = '', duration = '', diff --git a/features/support/shared_steps.js b/features/support/shared_steps.js index 5dd86473c..fb21e17bf 100644 --- a/features/support/shared_steps.js +++ b/features/support/shared_steps.js @@ -39,6 +39,8 @@ module.exports = function () { let json = JSON.parse(body); + got.code = json.code; + let hasRoute = json.code === 'Ok'; if (hasRoute) {