I'm trying to set up testing on my ActiveResource project. The
HttpMock appears to be what I want, but whenever I use the code in the
"documentation", I get the error
NameError: uninitialized constant ActiveResource::HttpMock
Is there something I need to do to enable HttpMock testing?
I’ve never used HttpMock for testing, but I’d recommend checking out Fakeweb (http://fakeweb.rubyforge.org/) for testing against external resource. I use it for ActiveResource calls and for hitting other external APIs.
Hope that helps.
require 'active_resource/http_mock' first
Oh wow. That was easy. Thanks Jeremy!
p.s. Did you find that documented somewhere?
Keep up to date with Rails on Twitter and This Week in Rails
Policies: Conduct, License, Maintenance, Security, Trademarks