turkan wrote in post #961926: > Hello. > > How do you test your web services and XHR requests? > > Like many of us I have `render :xml => @obj` in my controllers. I also > have something like `render :json => @obj if xhr?` in my controller. I > also use some custom XML serialization in my models by overriding > to_json and as_json. > > How do you test that all? I test the custom serialization in my model. > But ask myself where to test the other stuff.
In your Cucumber stories, of course! > In the controller tests? > There I can stub a model, use the `get` or `xhr` method for example > and evaluate the returned response.body. Or should I test that as an > integration test? The problem is that with Capybara (using it with > Steak) I can't do post or xhr requests (Capybara is get only). Controller and integration tests are needlessly painful. Skip them. Use Cucumber. > > Best regards, > Kai Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.