From: Andy Allan Date: Fri, 31 Mar 2017 09:40:49 +0000 (+0100) Subject: Add factories for relations, relation_members, ways and way_nodes X-Git-Tag: live~4001^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/1b7ab315bb7d241c5a0521f0810a0981e9031fc4 Add factories for relations, relation_members, ways and way_nodes --- diff --git a/test/factories/relation.rb b/test/factories/relation.rb new file mode 100644 index 000000000..f53245c1b --- /dev/null +++ b/test/factories/relation.rb @@ -0,0 +1,9 @@ +FactoryGirl.define do + factory :relation do + timestamp Time.now + visible true + version 1 + + changeset + end +end diff --git a/test/factories/relation_member.rb b/test/factories/relation_member.rb new file mode 100644 index 000000000..b3f69e3e9 --- /dev/null +++ b/test/factories/relation_member.rb @@ -0,0 +1,9 @@ +FactoryGirl.define do + factory :relation_member do + member_role "" + + relation + # Default to creating nodes, but could be ways or relations as members + association :member, :factory => :node + end +end diff --git a/test/factories/way.rb b/test/factories/way.rb new file mode 100644 index 000000000..f5d9ab071 --- /dev/null +++ b/test/factories/way.rb @@ -0,0 +1,9 @@ +FactoryGirl.define do + factory :way do + timestamp Time.now + visible true + version 1 + + changeset + end +end diff --git a/test/factories/way_node.rb b/test/factories/way_node.rb new file mode 100644 index 000000000..203c055a7 --- /dev/null +++ b/test/factories/way_node.rb @@ -0,0 +1,8 @@ +FactoryGirl.define do + factory :way_node do + sequence_id 1 + + way + node + end +end