search for: httpmock

Displaying 7 results from an estimated 7 matches for "httpmock".

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...
2010 Jul 02
3
Ticket #5038 ActiveResource not handling updates correctly
...ributes_from_response(response) if !response[''Conent-Length''].blank? && response[''Content-Length''] ! = "0" && response.body.strip.size > 0 load(self.class.format.decode(response.body)) end end This brings up an issue with the HttpMock class included with ActiveRecord. It defaults to specifying a Content-Type header of 0 for all requests that don''t have a body. Assuming Rack has the HTTP rules correct (204 shouldn''t have that header), then the HttpMock class is also broken. I''ve just started cloning...
2010 Aug 29
0
Troll - A Rails plugin for making webservice mocking easier
Hi Folks, Troll trumps your existing ActiveResource mocking libraries like inbuilt HttpMock,Fakeweb or Webmock out of water. With Troll, ActiveResource mocking just works, some of its features: 1. Don''t need to mock calls at Net::HTTP level (which webmock,fakeweb do). Really, we don''t care what HTTP library ActiveResource uses, fakeweb and webmock bring additional comp...
2008 Mar 01
0
Testing XML over HTTP in a Rails app
...e.g: curl -H "Accept: application/xml" -X GET --basic -u user:password http://myapp:3000/clients However I''d really like automated functional tests for all these methods, just as I have for the HTML responses in my controllers. I''ve read a little about ActiveResource::HttpMock which looks like it could be useful, but ideally I''d like to test the actual XML requests to my controllers. Can anyone shed any light on the correct way to do this and any reading resources? Thanks a lot, Olly --~--~---------~--~----~------------~-------~--~----~ You received this mess...
2008 Sep 04
0
ActiveResource testing
Hi, I''m trying to make some good testing on active resources, but I''ve some trouble with the *post* method. Basically this is my mock, where I set the POST verb and the expected URI. ActiveResource::HttpMock.respond_to do |mock| mock.post "/locations/buildings.xml?description=new- description&name=new-name", {}, @variable, 201 end Now, if I call the post method with the following code (the one I use into the controller), it says correctly that doesn''t found the correct mat...
2009 Apr 10
0
ActiveRecord belongs_to ActiveResource
...esting. Specifically functionally test the things_controller. The things controller is simple scaffold, however, having the association to an active resource model causes functional tests to error because they don''t make the required request to the resource, dispite using the ActiveRecord::HttpMock... mechanism in the functional test. So I have three questions really. One, is this type of relationship something that we can expect to work in rails? Or am I running off the rails here? Two, assuming that this is an acceptable use case. Using TDD, as apposed to BDD. Is there infrastructure alrea...