Closed tcannonfodder closed 12 years ago
I should document this but I usually proceed with one of the following:
user.stub(:process_geocoding)
With user
an instance_variable:
user.instance_eval do
def process_geocoding; end
end
Rethinking the design, I guess I'd better use a before_filter
instead of a validator.
Would you overwrite the existing method in the spec_helper
?
Would you have to rewrite something in the gem, or is that something that the test suite would have to implement?
On Mar 17, 2012, at 3:55 PM, Benjamin Roth wrote:
Rethinking the design, I guess I'd better use a
before_filter
instead of a validator.
Reply to this email directly or view it on GitHub: https://github.com/apneadiving/Google-Maps-for-Rails/issues/164#issuecomment-4556602
Just realized what you need is only a factory where you set the geocoding checker to true
(gmaps
is the default name).
Please close the Issue if it answers :)
I think it'd be extremely useful to allow geocoding to be disabled for a model within a test suite. That way, developers don't accidentally reach the allowance provided by geocoding servers (such as how Google Maps only allows 2,500 requests per day) while their test suite is running. I'd be willing to attempt to implement this (I've never worked on a gem before), or provide documentation for the feature if it has already been completed.