Class: Decidim::Map::Provider::Autocomplete::Test

Inherits:
Autocomplete show all
Defined in:
decidim-dev/lib/decidim/dev/test/rspec_support/geocoder.rb

Defined Under Namespace

Classes: Builder

Instance Attribute Summary

Attributes inherited from Utility

#configuration, #locale, #organization

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Frontend

#builder_class, #create_builder

Methods inherited from Utility

#initialize

Constructor Details

This class inherits a constructor from Decidim::Map::Utility

Class Method Details

.add_stub(address, coordinates) ⇒ Object


49
50
51
52
53
54
# File 'decidim-dev/lib/decidim/dev/test/rspec_support/geocoder.rb', line 49

def self.add_stub(address, coordinates)
  stubs.push(
    properties: address.is_a?(Hash) ? address : { street: address },
    geometry: { coordinates: coordinates }
  )
end

.clear_stubsObject


56
57
58
# File 'decidim-dev/lib/decidim/dev/test/rspec_support/geocoder.rb', line 56

def self.clear_stubs
  @stubs = []
end

.stubsObject


45
46
47
# File 'decidim-dev/lib/decidim/dev/test/rspec_support/geocoder.rb', line 45

def self.stubs
  @stubs ||= []
end

Instance Method Details

#builder_optionsObject


60
61
62
# File 'decidim-dev/lib/decidim/dev/test/rspec_support/geocoder.rb', line 60

def builder_options
  { url: configuration.fetch(:url, nil) }.compact
end