tkwidmer/refugerestrooms — pull request #106 by backspace (2014-04-04 03:38:35+00:00)
Title: Add acceptance tests

As discussed in #99, here are some preliminary acceptance tests we can use to ensure that nothing gets broken when changes are introduced. The tests are run on Travis

The general idea is “inside-out development”, like shown in [this diagram](http://arnauld.github.io/incubation/jbehave-get-started/bdd-cycle-around-tdd-cycles.png). You describe the new feature in a high-level way (I used Cucumber for that), the test will initially fail. Then you add whatever you need at the lower levels, writing tests for them on the way. When you’ve added what you need, you run the feature test again, and it passes.

I learned about this in [The RSpec Book](http://pragprog.com/book/achbd/the-rspec-book) and it’s been of excellent use to me. (I have a PDF if anyone wants it)

If I were implementing #103, for instance, I’d write a feature like this:

```cucumber
Feature: Submit a restroom

Scenario: Show nearby restrooms when guessing from location
Given a restroom exists in Vancouver
When I guess my location on the submission page
Then I should see an existing restroom nearby
```

You can see the output of these three Cucumber tests on the [last Travis CI build](https://travis-ci.org/backspace/refugerestrooms/builds/22239807) for this fork.