Skip to content

Instantly share code, notes, and snippets.

@tsnow
Created February 26, 2010 22:48
Show Gist options
  • Save tsnow/316273 to your computer and use it in GitHub Desktop.
Save tsnow/316273 to your computer and use it in GitHub Desktop.
context 'a new address' do
setup { @address = Address.new}
context 'with a valid,resolvable place' do
setup {
@address.zipcode = 97202
geo_response = mock(GeoResponse)
{:success => true, :zip => 97202, :lng => 10, :lat => 10}.each{|method,resp| geo_response.stubs(method).returns(resp)}
Geokit::Geocoders::MultiGeocoder.should_recieve(:geocode).returns(geo_response)
}
should "create location" do
@address.save
assert_equal([10,10], @address.location.ll)
end
should "save changes to location" do
#needs the previous to happen, then i change the values, and try again.
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment