Welcome to mirror list, hosted at ThFree Co, Russian Federation.

location_steps.rb « step_definitions « features - github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 268aec049e7c1ee9a6f37b840e4260ae9560b487 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

When /^I allow geolocation$/ do
  page.execute_script <<-JS
    window.navigator = {
      geolocation: {
        getCurrentPosition: function(success) {
          success({coords: {latitude: 42.42424242, longitude: 3.14159}});
        }
      }
    };

    $.getJSON = function(url, myCallback) {
      if (url === "https://nominatim.openstreetmap.org/reverse?format=json&lat=42.42424242&lon=3.14159&addressdetails=3") {
        return myCallback({display_name: "locator address"});
      }
    };
  JS
end