Skip to content

Commit

Permalink
tests covering no route found
Browse files Browse the repository at this point in the history
  • Loading branch information
emiltin committed Apr 29, 2014
1 parent a1ecab2 commit ca11422
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions features/step_definitions/routing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@
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
Expand Down
23 changes: 23 additions & 0 deletions features/testbot/status.feature
Original file line number Diff line number Diff line change
@@ -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 |

0 comments on commit ca11422

Please sign in to comment.