Displaying 3 results from an estimated 3 matches for "http_mock".
2009 Jun 24
3
ActiveResource:: HttpMock
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?
Thanks,
Tom
2010 May 15
3
ActiveResource Mock Objects
Some of my tests use ActiveResource HttpMock requests and some of them
do not. Does anyone know if there is a way to disable the HttpMocks
after they have already been loaded? The method
ActiveResource::HttpMock.reset! only removes all the objects, but
ActiveResource still thinks it should look for mock requests rather
than actually making requests. I hope this makes sense!
Thanks,
Tom
--
2010 Aug 29
0
Troll - A Rails plugin for making webservice mocking easier
...service call made, that makes debugging easier.
5. The most recent mock should be applied first.
An example to make things clearer:
Including the Module in ActiveSupport::TestCase (test_helper.rb),
class ActiveSupport::TestCase
include Troll::TestUnitStuff
end
and setup block of your tests:
http_mock(:post, "/articles.xml",{:times => 1,:body => /frodo/},{:body
=> fixture_file(''article_1.xml''), :status => 201})
More can be found in test directory of plugin and README.
Gotchas:
1. Works only with Test/Unit currently. Patches welcome for RSpec support.
2....