# Few questions about assert\_select\_rjs

**URL:** <https://www.ruby-forum.com/t/few-questions-about-assert-select-rjs/104472>\
**Category:** Rails\
**Created:** [May 18, 2007, 12:52pm UTC](https://www.ruby-forum.com/t/few-questions-about-assert-select-rjs/104472 "2007-05-18T12:52:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [May 18, 2007, 12:52pm UTC](https://www.ruby-forum.com/t/few-questions-about-assert-select-rjs/104472/1 "2007-05-18T12:52:36Z")

</div>

Hello, I’m trying to learn how to test RJS calls and when running  
functional tests I get two problems :

1. Why does @response.body contain  
“\r\n\<html  
xmlns="[http://www.w3.org/1999/xhtml\](http://www.w3.org/1999/xhtml%5C)” lang="en"  
xml:lang="en"\>\r\n\r\n$("id").value =  
89;\nElement.update("ajax\_messages", "Document  
sauvegard\u00e9");\nElement.show("ajax\_messages");\nnew  
Effect.Fade("ajax\_messages",{duration:3});

…and not only the last (out of ) javascript statements ?

The controller works fine when I check the RJS returned by the Ajax call  
with Firebug

1. With $("id").value = 89;\nElement.update("ajax\_messages",  
"Document sauvegard\u00e9");\nElement.show("ajax\_messages");\nnew  
Effect.Fade("ajax\_messages",{duration:3});

I can assert\_select\_rjs “ajax\_messages”  
but assert\_select\_rjs “id” will always fail with “No RJS statement that  
replaces or inserts HTML content”

Is it due to the fact that $(“id”).value = 89 does not replace any HTML  
bloc ? So how can I check that $(“id”).value have been executed and  
value 89 affected to “id” ?

Thanks

---

<div class="post-metadata">

**Author:** ![nuno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/65b543/32.png) [@nuno](https://www.ruby-forum.com/u/nuno)\
**Post date:** [May 21, 2007, 6:40am UTC](https://www.ruby-forum.com/t/few-questions-about-assert-select-rjs/104472/2 "2007-05-21T06:40:38Z")

</div>

I didn’t find a solution, any idea someone ?  
Thanks
