How to simulate sharing geolocation with Capybara?
I've successfully used this in a Cucumber step definition:
page.execute_script "navigator.geolocation.getCurrentPosition = function(success) { success({coords: {latitude: 50.455755, longitude: 30.511565}}); }"