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


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

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

.clear_stubsObject


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

def self.clear_stubs
  @stubs = []
end

.stubsObject


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

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

Instance Method Details

#builder_optionsObject


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

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