Displaying 1 result from an estimated 1 matches for "act_as_mappable".
Did you mean:
acts_as_mappable
2012 Aug 03
1
Mock_model not recognizing act_as_mappable
...Location.al(:bounds=>bounds)l
@locations.sort_by_distance_from([bounds.center.lat,bounds.center.lng])
Rspec:
@location = mock_model(Location)
Location.stub(:all).and_return([@location])
@location.stub!(:sort_by_distance_from).and_return([@location])
Within real model: Location
act_as_mappable
....
the :sort_by_distance_from is a method from within act_as_mappable.
Upon investigation, when I compare the available methods for both the
Location model and the mock_model, I found act_as_mappable is missing from
the mock_model.
Which accounts for why it was failing in the
stub @locat...