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
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0
Strict//EN\"\r\n
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html
xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\"
xml:lang=\"en\">\r\n<head></body>\r\n</html>$(\"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 <html>) javascript statements ?
The controller works fine when I check the RJS returned by the Ajax call
with Firebug
2) 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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---