search for: sort_by_distance_from

Displaying 1 result from an estimated 1 matches for "sort_by_distance_from".

2012 Aug 03
1
Mock_model not recognizing act_as_mappable
I am using mock_model in my tests, and I encountered a situation where my stub is failing. Here''s the scenario: Controller: @locations = 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 fro...