From ca65a3d50e9cd7716ff3ec3588947e313f7d9c39 Mon Sep 17 00:00:00 2001 From: Jonathan Kolyer Date: Sun, 3 Nov 2013 08:08:25 -0600 Subject: [PATCH] vrfs-774: fixed inconsistent test failures --- ruby/spec/jam_ruby/models/user_location_spec.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ruby/spec/jam_ruby/models/user_location_spec.rb b/ruby/spec/jam_ruby/models/user_location_spec.rb index 11bd1226a..3a7d68020 100644 --- a/ruby/spec/jam_ruby/models/user_location_spec.rb +++ b/ruby/spec/jam_ruby/models/user_location_spec.rb @@ -21,16 +21,18 @@ X If no profile location is provided, and the user creates/joins a music session describe "with profile location data" do it "should have lat/lng values" do - @user.lat.should == @geocode1.lat - @user.lng.should == @geocode1.lng + geo = MaxMindGeo.find_by_city(@user.city) + @user.lat.should == geo.lat + @user.lng.should == geo.lng end it "should have updated lat/lng values" do @user.update_attributes({ :city => @geocode2.city, :state => @geocode2.region, :country => @geocode2.country, }) - @user.lat.should == @geocode2.lat - @user.lng.should == @geocode2.lng + geo = MaxMindGeo.find_by_city(@user.city) + @user.lat.should == geo.lat + @user.lng.should == geo.lng end end @@ -47,8 +49,8 @@ X If no profile location is provided, and the user creates/joins a music session geo = JamRuby::MaxMindGeo.ip_lookup('1.1.0.255') geo.should_not be_nil @user.update_lat_lng('1.1.0.255') - @user.lat.should == @geocode1.lat - @user.lng.should == @geocode1.lng + @user.lat.should == geo.lat + @user.lng.should == geo.lng end end