# Assert\_select\_rjs behaving strangely

**URL:** <https://www.ruby-forum.com/t/assert-select-rjs-behaving-strangely/126511>\
**Category:** Rails\
**Created:** [January 18, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/assert-select-rjs-behaving-strangely/126511 "2008-01-18T21:40:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@eric](https://www.ruby-forum.com/u/eric)\
**Post date:** [January 18, 2008, 9:40pm UTC](https://www.ruby-forum.com/t/assert-select-rjs-behaving-strangely/126511/1 "2008-01-18T21:40:44Z")

</div>

Before, I had this in my RJS template:

```
page['order'].replace_html :partial => 'order'

```

When I use assert\_select\_rjs as follows:

```
assert_select_rjs :replace_html, 'order'

```

I get the error:

```
No RJS statement that replaces or inserts HTML content.

```

But when I change the RJS template to this:

```
page.replace_html 'order', :partial => 'order'

```

Then assert\_select\_rjs works fine. What gives?

Thanks,  
Eric

---

<div class="post-metadata">

**Author:** ![eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@eric](https://www.ruby-forum.com/u/eric)\
**Post date:** [January 20, 2008, 7:38pm UTC](https://www.ruby-forum.com/t/assert-select-rjs-behaving-strangely/126511/2 "2008-01-20T19:38:54Z")

</div>

Eric wrote:

> ```
> No RJS statement that replaces or inserts HTML content.
> 
> ```
> 
> >

You need something like (from memory)  
assert\_select\_rjs :chained\_replace\_html, ‘order’

See the API docs for assert\_select\_rjs. Seem to remember there’s a bit  
about chained replace (but not much).  
HTH  
Chris

## –

Autopendium :: Stuff about old cars  
[http://autopendium.com](http://autopendium.com)

---

<div class="post-metadata">

**Author:** ![eric](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@eric](https://www.ruby-forum.com/u/eric)\
**Post date:** [January 23, 2008, 1:34am UTC](https://www.ruby-forum.com/t/assert-select-rjs-behaving-strangely/126511/3 "2008-01-23T01:34:40Z")

</div>

I see… I saw that chained replace thing too, was wondering what it was  
for… now I knows. Thanks.
