]> git.openstreetmap.org Git - rails.git/blobdiff - test/factories/notes.rb
Add some more tests, better error handling for dates
[rails.git] / test / factories / notes.rb
index 52c23e7d69cd9ead70abf291e7522101f5710d18..56a9541dcc56548414aa0104e98f965da8771caf 100644 (file)
@@ -1,7 +1,17 @@
-FactoryGirl.define do
+FactoryBot.define do
   factory :note do
     latitude 1 * GeoRecord::SCALE
     longitude 1 * GeoRecord::SCALE
     # tile QuadTile.tile_for_point(1,1)
+
+    factory :note_with_comments do
+      transient do
+        comments_count 1
+      end
+
+      after(:create) do |note, evaluator|
+        create_list(:note_comment, evaluator.comments_count, :note => note)
+      end
+    end
   end
 end