Hello, I’m trying to learn how to test RJS calls and when running
functional tests I get two problems :
- 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
- 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