Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brentgreeff/should_pricot
Test the html in your functional tests using the wicked Hpricot CSS / XPath selectors.
https://github.com/brentgreeff/should_pricot
automated-testing rails
Last synced: about 7 hours ago
JSON representation
Test the html in your functional tests using the wicked Hpricot CSS / XPath selectors.
- Host: GitHub
- URL: https://github.com/brentgreeff/should_pricot
- Owner: brentgreeff
- License: mit
- Created: 2009-07-14T16:38:10.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-01-13T09:09:36.000Z (almost 14 years ago)
- Last Synced: 2024-11-16T02:39:10.451Z (4 days ago)
- Topics: automated-testing, rails
- Language: Ruby
- Homepage: http://www.brentgreeff.com/rails-plugins/should-pricot
- Size: 310 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: MIT-LICENSE
Awesome Lists containing this project
README
= ShouldPricot
Test the html in your functional tests
using the wicked Hpricot CSS / XPath selectors.
Requires Hpricot.
Designed for use with ActiveSupport::TestCase (Test/Unit)== Install
gem install should_pricot
(or use bundler)== Example
* I want to test something appears on the page:
element('h1').should_be_present
* I want to test something does not appear:
element('#power_user a[@href="/create/havok"]').should_be_missing* I want to check an elements contents:
element('.intro p').should_be 'Welcome'* I want to count the number of times something appears:
count('ol#girlfriends li').should_be 6* You can also pass a regex
element("div.wicked").should_be /containg this/
* Even better
element('.date').should_contain "today"
* You can also pass in html
element("div.wicked", some_html).should_be_presentPlease refer to the Hpricot library for more examples
of the kind of selectors available.== Funktional
Designed to be used with the funktional testing library which provides
contexts and class level assertions on top of Test:Unit.Mad props to Kid80 for the regex matching patch.
Copyright (c) 2009 [Brent Greeff], released under the MIT license