tests covering no route found

This commit is contained in:
Emil Tin 2014-04-29 17:53:35 +02:00 committed by Dennis Luxen
parent 7b0b378abc
commit 85148d1283
2 changed files with 29 additions and 0 deletions

View File

@ -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

View File

@ -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 |