# Assert\_select\_rjs testing question

**URL:** <https://www.ruby-forum.com/t/assert-select-rjs-testing-question/184399>\
**Category:** Rails\
**Created:** [March 1, 2010, 11:07pm UTC](https://www.ruby-forum.com/t/assert-select-rjs-testing-question/184399 "2010-03-01T23:07:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![russianbandit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e36b37/32.png) [@russianbandit](https://www.ruby-forum.com/u/russianbandit)\
**Post date:** [March 1, 2010, 11:07pm UTC](https://www.ruby-forum.com/t/assert-select-rjs-testing-question/184399/1 "2010-03-01T23:07:09Z")

</div>

I’m using assert\_select\_rjs for testing my RJS code.  
If my RJS code is:

page.replace\_html “errors”,  
“” + @item.errors.full\_messages.to\_s + “”

I know that I can test it like so:

assert\_select\_rjs :replace\_html, “errors” do  
assert\_select “span”, “Error happened”  
end

The question I have, is there any way to verify the error text without  
wrapping it in the tag? It just would be much cleaner in my .rjs  
file if I didn’t have to do that.
