Forum: Ruby on Rails Unit/Functional testing for AJAX functions?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sean H. (Guest)
on 2005-12-20 01:56
(Received via mailing list)
I really have no more input than that, so the subject speaks for
itself.  How do you test that AJAX effects shown in the browser are
actually happening?  Maybe an auto-complete form field is a good
starting example.

Sean
Alex Y. (Guest)
on 2005-12-21 11:26
(Received via mailing list)
Sean H. wrote:
> I really have no more input than that, so the subject speaks for
> itself.  How do you test that AJAX effects shown in the browser are
> actually happening?  Maybe an auto-complete form field is a good
> starting example.
>
> Sean
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails

You can functionally test the XmlHttpRequest calls from the controller
test cases.  There's the xml_http_request method, which looks like:

def test_xml_http_request
   xml_http_request :post, action, {params_for_action}
   assert something_about_response
end

That tests the rails side of things.  For the browser execution of any
code, you'll need to break out either Selenium or Watir (or both)
depending on your platform preference.
Sean H. (Guest)
on 2005-12-23 05:58
(Received via mailing list)
Thank you!  Exactly what I was looking for.

And this pops up on the RoR weblog:

http://www-128.ibm.com/developerworks/java/library...
This topic is locked and can not be replied to.