Created
July 31, 2009 20:37
-
-
Save rmanalan/159432 to your computer and use it in GitHub Desktop.
Cucumber step for testing text content inside a tag
This file contains hidden or 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
| # For testing text content within a tag. First param is a CSS3 selector, | |
| # while second param is a regex | |
| Then /^the "([^\"]*)" should have "([^\"]*)"$/ do |element,content| | |
| response.body.should have_selector(element) do |node| | |
| node.text.should =~ /#{content}/ | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment