I’ve got a controller that fires off an ActiveResource request during its execution. Included in that request is an id that is generated as a part of my controller execution (so, /a/b/{my_id}/c.xml, where my_id is a value that is generated by the controller).
I don’t want my test cases to trigger actual live requests, but I also don’t want the calls to fail (I need a 200 response).
I’ve looked at HttpMock, which seems like a good solution, but it does not appear to allow for wild cards or regular expressions within the respond_to block (e.g.) which are necessary because the generated id is a part of the request.
Is there a way to do this? I’ve been looking but I haven’t seen anything yet, and the HttpMock documentation doesn’t mention it at all.
I’d recommend either mocking out the web service calls with FakeWeb or using traditional mocking on the ActiveResource layer itself.
…or mocking with Mocha: