Fixed the test setup and added the text for the bug found in 'Enterprise.find_near'.

This commit is contained in:
alexs
2013-08-15 17:34:51 +10:00
parent a7256611cf
commit b8bc30d4ab

View File

@@ -241,12 +241,19 @@ describe Enterprise do
address_vic2 = FactoryGirl.create(:address, state_id: state_id_vic, city: "Richmond", zipcode: "3121")
address_vic2.update_column(:latitude, -37.826869)
address_vic2.update_column(:longitude, 145.007098)
FactoryGirl.create(:distributor_enterprise, address: address_vic1)
FactoryGirl.create(:distributor_enterprise, address: address_vic2)
end
it "should find nearby hubs if there are any" do
Enterprise.find_near(@suburb_in_vic).count.should eql(2)
end
it "should not have nils in the result" do
Enterprise.find_near(@suburb_in_vic).should_not include(nil)
end
it "should not find hubs if not nearby " do
Enterprise.find_near(@suburb_in_nsw).count.should eql(0)
end