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 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).

Best regards,
Kai

-- 
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.

Reply via email to