Created
January 2, 2010 21:33
-
-
Save ncancelliere/267681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## manage_contact.feature (cucumber scenario) ### | |
Scenario: View list of contacts | |
Given 3 contacts exist # Pickle makes this line possible | |
When I go to the contact list | |
Then I should see 3 contacts | |
## custom_steps.rb (cucumber step-definition) ### | |
Then /^(?:|I )should see (\d+) (.*)$/ do |count, selector| | |
response.should have_selector(".#{selector.singularize}", :count => count.to_i) | |
end | |
## index.html.haml (view that's being tested) ### | |
%h1 Contact List | |
%table.contacts | |
%tr | |
%th Name | |
%th Email | |
%th Phone 1 | |
%th Phone 2 | |
- @contacts.each do |contact| | |
%tr.contact | |
%td= contact.name | |
%td= contact.email | |
%td= contact.phone1 | |
%td= contact.phone2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment