diff --git a/ruby/spec/jam_ruby/models/max_mind_isp_spec.rb b/ruby/spec/jam_ruby/models/max_mind_isp_spec.rb index 09e9242c6..b61f86cfc 100644 --- a/ruby/spec/jam_ruby/models/max_mind_isp_spec.rb +++ b/ruby/spec/jam_ruby/models/max_mind_isp_spec.rb @@ -19,25 +19,25 @@ describe MaxMindIsp do MaxMindIsp.import_from_max_mind(ISP_CSV) end - let(:first) { MaxMindIsp.find_by_ip_bottom('1.0.0.0') } - let(:second) { MaxMindIsp.find_by_ip_bottom('1.0.1.0') } - let(:third) { MaxMindIsp.find_by_ip_bottom('1.0.4.0') } + let(:first) { MaxMindIsp.find_by_ip_bottom(MaxMindIsp.ip_address_to_int('1.0.0.0')) } + let(:second) { MaxMindIsp.find_by_ip_bottom(MaxMindIsp.ip_address_to_int('1.0.1.0')) } + let(:third) { MaxMindIsp.find_by_ip_bottom(MaxMindIsp.ip_address_to_int('1.0.4.0')) } it { MaxMindIsp.count.should == 3 } it { first.country.should == 'AU' } - it { first.ip_bottom.should == '1.0.0.0' } - it { first.ip_top.should == '1.0.0.255' } + it { first.ip_bottom.should == MaxMindIsp.ip_address_to_int('1.0.0.0') } + it { first.ip_top.should == MaxMindIsp.ip_address_to_int('1.0.0.255') } it { first.isp.should == 'APNIC Debogon Project' } it { second.country.should == 'CN' } - it { second.ip_bottom.should == '1.0.1.0' } - it { second.ip_top.should == '1.0.1.255' } + it { second.ip_bottom.should == MaxMindIsp.ip_address_to_int('1.0.1.0') } + it { second.ip_top.should == MaxMindIsp.ip_address_to_int('1.0.1.255') } it { second.isp.should == 'Chinanet Fujian Province Network' } it { third.country.should == 'AU' } - it { third.ip_bottom.should == '1.0.4.0' } - it { third.ip_top.should == '1.0.7.255' } + it { third.ip_bottom.should == MaxMindIsp.ip_address_to_int('1.0.4.0') } + it { third.ip_top.should == MaxMindIsp.ip_address_to_int('1.0.7.255') } it { third.isp.should == 'Bigred,inc' } end