Sha256: 5e73ac2d3b0945fd91558518979433e2e19cfc1f305ebd9e6607c773e8fb13a0
Contents?: true
Size: 1.21 KB
Versions: 7
Compression:
Stored size: 1.21 KB
Contents
# -*- encoding : utf-8 -*- require 'wagn/spec_helper' describe GoogleMapsAddon do before(:each) do @geotest = Card.new(:name=>"Geotest") end it "should do nothing given no configuration" do @geotest.save Card["Geotest+*geocode"].should be_nil end context "given a *geocode configuration" do before(:each) do Account.as_bot do Card.create! :name=>"*geocode", :content => "[[street address]]\n[[zip]]", :type=>'Pointer' end end it "should save geocoding to +*geocode when configured cards card are present" do mock(GoogleMapsAddon).geocode("519 Peterson St 80524").returns('40.581144, -105.071947') Account.as_bot do # FIXME: rules for this should be standard? Card.create :name=>"*geocode+*right+*update", :content=>'[[Anyone Signed In]]' Card.create :name=>"*geocode+*right+*create", :content=>'[[Anyone Signed In]]' end Card.create! :name=>"Ethan's House+street address", :content => "519 Peterson St 80524" Card["Ethan's House+*geocode"].should_not be_nil Card["Ethan's House+*geocode"].type_code.should == :phrase Card["Ethan's House+*geocode"].content.should == '40.581144, -105.071947' end end end
Version data entries
7 entries across 7 versions & 1 rubygems