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