Check this out http://goessner.net/articles/JsonPath/
You could assert that the specific "fields" in the object returned are there, which is in my opinion a better way to go than checking if JSON.parse(response.body) won't raise an exception :) On Mon, Aug 17, 2009 at 10:45 AM, MarkBennett<[email protected]> wrote: > > I'm writing a Rails controller which will output data using the Google > Visualization wire format (http://code.google.com/apis/visualization/ > documentation/dev/implementing_data_source.html#htmldatatable). It's > a JSON format and I'd like to test that my controller is correctly > outputting JSON with the proper mime-type and content in it. > > What is the right way to do this in rails? What testing tools should > I be using? > > Thanks in advance. This is a great group! :) > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en -~----------~----~----~----~------~----~------~--~---
