+1 for WebMock Also, you can also use https://github.com/martinbtt/net-http-spy so you can properly mock the responses to your HTTP requests. There is also this gem: https://github.com/myronmarston/vcr , which wraps much of the functionality of net-http-spy, but I do not have personal experience using it.
Ben On Wed, Feb 8, 2012 at 11:39 AM, Dan Simpson <[email protected]> wrote: > Check this out: https://github.com/bblimke/webmock > > --Dan > > On Wed, Feb 8, 2012 at 11:31 AM, Cliff Rhyne <[email protected]> wrote: > > Here's my problem in a nutshell: > > > > I have a Ruby on Rail app I'm building that needs to execute an HTTP > > POST to another app (not in Ruby). I want to setup automated tests > > for these where either the underlying POST is mocked (or using a > > simulator for the other service, which we want anyway for QA > > testing). I'm trying to follow good practice and not build in test > > support to production code. > > > > Anyone have any suggestions? > > > > Thanks you, > > Cliff > > > > (on a side note, I did a google search but the results were largely > > about testing the POST method for the RoR app itself) > > > > -- > > SD Ruby mailing list > > [email protected] > > http://groups.google.com/group/sdruby > > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby > -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
