From 85148d1283ee776f3f72f89cc89d1d47c7185e53 Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Tue, 29 Apr 2014 17:53:35 +0200 Subject: [PATCH] tests covering no route found --- features/step_definitions/routing.rb | 6 ++++++ features/testbot/status.feature | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 features/testbot/status.feature diff --git a/features/step_definitions/routing.rb b/features/step_definitions/routing.rb index ecefd79be..3628d4831 100644 --- a/features/step_definitions/routing.rb +++ b/features/step_definitions/routing.rb @@ -98,6 +98,12 @@ When /^I route I should get$/ do |table| if table.headers.include? 'distances' got['distances'] = distances end + if table.headers.include? 'status' + got['status'] = json['status'].to_s + end + if table.headers.include? 'message' + got['message'] = json['status_message'] + end if table.headers.include? '#' # comment column got['#'] = row['#'] # copy value so it always match end diff --git a/features/testbot/status.feature b/features/testbot/status.feature new file mode 100644 index 000000000..138b5a54f --- /dev/null +++ b/features/testbot/status.feature @@ -0,0 +1,23 @@ +@routing @status +Feature: Status messages + + Background: + Given the profile "testbot" + + Scenario: No route found + Given the node map + | a | b | + | | | + | c | d | + + Given the ways + | nodes | + | ab | + | cd | + + When I route I should get + | from | to | route | status | message | + | a | b | ab | 0 | Found route between points | + | c | d | cd | 0 | Found route between points | + | a | c | | 207 | Cannot find route between points | + | b | d | | 207 | Cannot find route between points |