diff --git a/features/support/exception_classes.js b/features/support/exception_classes.js index 9740be580..36e76da44 100644 --- a/features/support/exception_classes.js +++ b/features/support/exception_classes.js @@ -101,8 +101,8 @@ module.exports = { if (rowError) { bad++; - this.diff.push(Object.assign({}, row, {status: 'undefined'})); - this.diff.push(Object.assign({}, actual[i], {status: 'comment'})); + this.diff.push(Object.assign({}, row, {c_status: 'undefined'})); + this.diff.push(Object.assign({}, actual[i], {c_status: 'comment'})); } else { good++; this.diff.push(row); @@ -118,8 +118,8 @@ module.exports = { this.diff.forEach((row) => { var rowString = '| '; this.headers.forEach((header) => { - if (!row.status) rowString += ' ' + row[header] + ' | '; - else if (row.status === 'undefined') rowString += '(-) ' + row[header] + ' | '; + if (!row.c_status) rowString += ' ' + row[header] + ' | '; + else if (row.c_status === 'undefined') rowString += '(-) ' + row[header] + ' | '; else rowString += '(+) ' + row[header] + ' | '; }); s.push(rowString); diff --git a/features/support/shared_steps.js b/features/support/shared_steps.js index 90ae95729..4fb78febd 100644 --- a/features/support/shared_steps.js +++ b/features/support/shared_steps.js @@ -47,11 +47,11 @@ module.exports = function () { } if (headers.has('status')) { - got.status = json.status.toString(); + got.status = res.statusCode.toString(); } if (headers.has('message')) { - got.message = json.status_message; + got.message = json.message || ''; } if (headers.has('#')) { diff --git a/features/testbot/status.feature b/features/testbot/status.feature index 86d825921..4b9074a74 100644 --- a/features/testbot/status.feature +++ b/features/testbot/status.feature @@ -14,8 +14,8 @@ Feature: Status messages When I route I should get | from | to | route | status | message | - | a | b | ab | 200 | Found route between points | - | b | a | ab | 200 | Found route between points | + | a | b | ab | 200 | | + | b | a | ab | 200 | | Scenario: No route found Given the node map @@ -30,10 +30,10 @@ Feature: Status messages When I route I should get | from | to | route | status | message | - | a | b | ab | 200 | Found route between points | - | c | d | cd | 200 | Found route between points | - | a | c | | 207 | Impossible route between points | - | b | d | | 207 | Impossible route between points | + | a | b | ab | 200 | | + | c | d | cd | 200 | | + | a | c | | 400 | Impossible route between points | + | b | d | | 400 | Impossible route between points | Scenario: Malformed requests Given the node locations @@ -47,7 +47,7 @@ Feature: Status messages When I route I should get | request | status | message | - | viaroute?loc=1,1&loc=1.01,1 | 200 | Found route between points | + | viaroute?loc=1,1&loc=1.01,1 | 200 | | | nonsense | 400 | Service not found | | nonsense?loc=1,1&loc=1.01,1 | 400 | Service not found | | | 400 | Query string malformed close to position 0 | @@ -61,7 +61,7 @@ Feature: Status messages | viaroute?loc=x,y | 400 | Query string malformed close to position 9 | | viaroute?loc=1,1&loc= | 400 | Query string malformed close to position 17 | | viaroute?loc=1,1&loc=1 | 400 | Query string malformed close to position 17 | - | viaroute?loc=1,1&loc=1,1 | 200 | Found route between points | + | viaroute?loc=1,1&loc=1,1 | 200 | | | viaroute?loc=1,1&loc=1,1,1 | 400 | Query string malformed close to position 25 | | viaroute?loc=1,1&loc=x | 400 | Query string malformed close to position 17 | | viaroute?loc=1,1&loc=x,y | 400 | Query string malformed close to position 17 |