rubymonsters/speakerinnen_liste — pull request #21 by fidothe (2013-03-26 09:38:51+00:00)
Title: Added Capybara and got it working correctly

This adds the Capybara gem, and does the basic setup needed to use it in Rails' Integration tests.

I made one of our example integration tests work with it in `test/integration/user_redirected_to_login_test.rb`.

Useful documentation here:

http://rubydoc.info/github/jnicklas/capybara#The_DSL

The thing to remember is that with Capybara you're driving your web app as if you were a person driving it with a browser. So, you need to start off by visiting a page with `visit`, and interacting with by filling in form fields (with `fill_in`) or clicking links or buttons (`click_link`, `click_button`). If you perform an action that would take you to another page, e.g. clicking a link or submitting a form, Capybara will follow the link or submit the form.

The finders for form fields are great, but they rely on you using good form markup.

That just means code like this:

```
An opinion
```

You could fill in that field with capybara using:

```
fill_in 'An opinion', :with => 'blah blah'
```

Don't forget you'll then need to click the submit button...