Few questions about assert_select_rjs

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” 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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs