How do you test your REST API with XML?

So far I've been manually using curl to make get and post requests
against my Rails app to see if I'm responding to XML clients

But this is silly, I need to write unit tests. I don't see an obvious
way to do this in Rails unit tests. I'm about to invent an
'xml_fixtures' helper method that will pull in some hardcoded XML
files, and then use those to make post requests and/or make sure I get
the expected XML back from the server.

But before I invest the time - is there a better way?


You can do it with integration tests, but I agree that there ought to
be a lower-level approach

This really doesn't make sense to be available from unit tests. The
format that is returned is controlled by the controller class, not the
model, so the proper place to test this is in functional and/or
integration test.