Then yes look into FakeWeb. It is awesome ... you can stub out the return to a specific URL with certain parameters. Sounds like exactly what you are looking for
On Thu, Apr 16, 2009 at 9:27 AM, Rob Mitchell <robm.mitch...@gmail.com> wrote: > > The ajax calls are all going through the controllers in the ui > application. All calls to the indexing application are through the > contollers using ActiveResource, so my option at the moment is to stub > out the ActiveResource calls. > > Rob > On Apr 16, 9:23 am, Torm3nt <torm...@gmail.com> wrote: >> How would you stub them if they're via ajax? >> >> I'd be setting up the service locally and ensure the ajax requests are >> respecting the environment you're running in (prod/dev/test.etc.). >> >> Kirk >> >> On Thu, Apr 16, 2009 at 9:18 AM, Craig Ambrose <craigambr...@gmail.com> >> wrote: >> >> > You may have already done this, but I'd start by creating a new rails >> > environment to run the server in for acceptance testing. That >> > environment can mimic production.rb in some ways, and test.rb in >> > others, but obviously gives you a place to load in whatever library >> > you use to stub out the external service. Perhaps the same stubs that >> > you use for controller tests might work. >> >> > So, I guess I'm suggesting stubbing the external calls at the ruby >> > level, at the lowest level function that you can find (like http >> > open), rather than stubbing them in a more physical way on the machine >> > (like actually having a process listening on another port and >> > pretending to be the other service). >> >> > Craig >> >> > On Apr 16, 11:09 am, Rob Mitchell <robm.mitch...@gmail.com> wrote: >> >> Hi All >> >> >> I have two applications that communicate over http. I have a page on >> >> the ui application that communicates with the indexing application >> >> using ajax. I'm in the process of testing this page using selenium and >> >> would like all calls to the indexing application to be stubbed as I >> >> don't want my tests to rely on this service being available. >> >> >> Anybody have any ideas of libraries or strategies to achieve this. I'm >> >> already stubbing out calls to the service in my controller tests, so >> >> that's taken care of. >> >> >> Thanks >> >> Rob >> >> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to rails-oceania@googlegroups.com To unsubscribe from this group, send email to rails-oceania+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~----------~----~----~----~------~----~------~--~---