I personally use rack/test and rest/client to test APIs apps. - Matt
On Oct 4, 2012, at 9:55, Thomaz Leite <[email protected]> wrote: > It seems you are looking for something to send requests and tests the > returned responses, so I don't think Capybara/Selenium/Webrat will help you > much because they serve better to test HTML interfaces (clicking > links/buttons, submitting forms). You probably want something like HTTParty > (https://github.com/jnunemaker/httparty). > > From my experience, the difficult part about integration-testing APIs is how > to setup the preconditions assumed by the test (e.g. existing records in a > database). If the API you are testing allows you to do this from the outside, > then you should be fine. Otherwise you probably want to setup your testing > environment on top of JRuby (for the interop. with Java) so you can call Java > code that will setup the preconditions for you. > > As mentioned before, the "magical" testing frameworks will eventually get in > your way, so I stick with minitest/unit+mocha as much as possible. > > -- Thomaz > > On Thursday, October 4, 2012 10:35:14 AM UTC-7, Chris McCann wrote: > In my day job I work on a large Java-based web app that uses a RESTful JSON > API to serve data to a JS-based front-end. Our QA folks are struggling a bit > with how best to do automated testing of the API. > > I've done some googling but come up empty-handed. Can anyone recommend a > solid integration testing framework that uses declarative (think "shoulda") > language for describing tests that we could use to exercise the API? > > Thanks, > > Chris > -- > SD Ruby mailing list > [email protected] > http://groups.google.com/group/sdruby -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
