Thanks Nathan, This looks to be exactly what I need! My testing has already turned up a problem though. The Google Vis DataSource API uses a custom query parameter which it stuffs with values like this:
http://mysite.com/datasource?tqx=key1:value1;key2:value2&normalparam=normalvalue They've gotten sneaky and use a query parameter where key:value pairs are separated by semicolons. Unfortunately the semicolon is a significant parameter separator so it's ripping the tqx values apart. Is there a way to change which parameter seperators are significant to Rails? On Aug 17, 11:23 am, Nathan de Vries <[email protected]> wrote: > On 17/08/2009, at 10:45 AM, MarkBennett wrote: > > > What is the right way to do this in rails? What testing tools should > > I be using? > > There are plenty of testing frameworks you can layer on top of the > most basic tests, but in general terms you're going to be writing > integration tests. It will look a little something like this: > > > class SomeControllerTest < ActionController::IntegrationTest > > def test_response_has_correct_json_content_type > > get '/some/action.json' > > assert 'application/x-json', response.content_type > > end > > def test_response_conforms_to_google_vis_wire_protocol > > get '/some/action.json' > > # run some checks on response.body, perhaps > > # using JsonPath (XPath for JSON) > > end > > end > > If your SomeController#action does some smart stuff you don't really > need to test, you'll need to look into stubbing the methods your > action is calling by using a mocking/stubbing framework. Once you've > got your tests working, then you can start to look into other test > frameworks that provide a little bit of extra syntax-sugar/convenience. > > Hope that helps! > > Cheers, > > Nathan de Vries --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
