assert_select_rjs behaving strangely

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

Eric wrote:

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

>

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

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