Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 public
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 Rakefile
Octocat-spinner-32 neverland.gemspec


Build Status

Neverland takes the pain out of testing HTML5 geolocation within your Rails app. For more on HTML5 geolocation, check out the spec.

Getting Started

To install, add the following to your Gemfile:

gem 'neverland'

In your test environment initializer, add the Neverland middleware:

Dummy::Application.configure do
  # ...

  config.middleware.use Neverland::Middleware

By default, Neverland will mock the result of navigator.geolocation.getCurrentLocation to latitude 42.31283, longitude -71.114287. This can be overridden by sending the parameters neverland[:latitude] and neverland[:longitude]. Error states can also be triggered by setting neverland[:error_code].


  • The implementation naievely overrides the browser's geolocation implementation by inserting a JavaScript tag into the response.

  • The middleware will treat the response body as HTML. If you're using XHTML, this could cause issues.

Something went wrong with that request. Please try again.