Skip to content
Snippets Groups Projects
Commit 78a87654 authored by Alex Reisner's avatar Alex Reisner
Browse files

Add section on tests.

parent 03d929b4
No related branches found
No related tags found
No related merge requests found
......@@ -323,6 +323,13 @@ There are few options for finding objects near a given point in SQLite without i
Because Geocoder needs to provide this functionality as a scope, we must go with option #1, but feel free to implement #2 or #3 if you need more accuracy.
== Tests
Geocoder comes with a test suite (just run <tt>rake test</tt>) that mocks ActiveRecord and is focused on testing the aspects of Geocoder that do not involve executing database queries. Geocoder uses many database engine-specific queries which must be tested against all supported databases (SQLite, MySQL, etc). Ideally this involves creating a full, working Rails application, and that seems beyond the scope of the included test suite. As such, I have created a separate repository which includes a full-blown Rails application and some utilities for easily running tests against multiple environments:
http://github.com/alexreisner/geocoder_test
== Known Issue
You cannot use the +near+ scope with another scope that provides an +includes+ option because the +SELECT+ clause generated by +near+ will overwrite it (or vice versa). Instead, try using +joins+ and pass a <tt>:select</tt> option to the +near+ scope to get the columns you want. For example, in Rails 2 syntax:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment