Forum: Ruby on Rails assert_select_rjs with on a page with "" in it

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Harlan Crystal (Guest)
on 2007-02-06 04:36
(Received via mailing list)
I'm having a bunch of testing an RJS action.  The action updates a DIV
if it
exists, but it isn't always necessarily present on the page so I use a in the RJS to check if it exists.  (Is there a better way to

Let's say we have an RJS page containing:"some_element_that_may_or_may_not_exist").each do |value|
  page.replace_html value, "something"

Writing a test like this fails:

assert_select_rjs "some_element_that_may_or_may_not_exist" do

so does:

assert_select_rjs do
  assert_select "some_element_that_may_or_may_not_exist", :count => 1

I'm assuming this is because of the "".  Anyone know of a way
deal with this?

This topic is locked and can not be replied to.