Forum: Ruby on Rails assert_select alternative

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
428167a3ec72235ba971162924492609?d=identicon&s=25 Yehuda Katz (Guest)
on 2007-01-28 17:33
Hey guys,

I was having issues with some of the way assert_select worked, so I
wrote an alternative to assert_select using hpricot.

The major differences:
* You get full support for CSS3 and limited XPath
* It uses hpricot, which is fast; plus you get improvements to hpricot
for
  free in assert_elements as long as you update the gem.
* Blocks work a bit differently (assert_elements tests whether any
matched
  elements passes all of the assert_elements inside the
block--assert_select
  tests whether the assert_selects in the block are true for the list of
  matched elements). I felt as though this was the more intuitive
solution,
  and you can read my reasoning on my blog.

You can read  about it at
http://yehudakatz.com/2007/01/27/a-better-assert_s...
This topic is locked and can not be replied to.