January 2012
Intermediate to advanced
336 pages
8h 12m
English
In Chapter 14, Bootstrapping Rails, we dabbled a little bit in Capybara’s API. We used the visit(path) method to go to a user’s page, and we verified that messages were displayed on the screen using Capybara’s have_content matcher. Let’s add a feature that will allow users to search for messages. This will expose us to more of the goodness Capybara has to offer.
Start with the code we left off with at the end of the previous chapter and add a new search feature to features/search.feature:
| capybara/00/features/search.feature | |
| | Feature: Search |
| | Scenario: Find messages by content |
| | Given a User has posted the following messages: |
| | | content | |
| | | I am making dinner | |
| | | I just woke up | |
Read now
Unlock full access