]> git.openstreetmap.org Git - rails.git/blobdiff - test/factories/user.rb
Add with_home_location trait for user factories.
[rails.git] / test / factories / user.rb
index ccbb84f93c5f4245a27014c0e21c24f9672fce30..79b9a2a1664b84941293500ab5e10b8672132f23 100644 (file)
@@ -3,5 +3,10 @@ FactoryGirl.define do
     sequence(:email) { |n| "user#{n}@example.com" }
     sequence(:display_name) { |n| "User #{n}" }
     pass_crypt Digest::MD5.hexdigest("test")
+
+    trait :with_home_location do
+      home_lat { rand(-90.0...90.0) }
+      home_lon { rand(-180.0...180.0) }
+    end
   end
 end