From 7f957bac76c6315a1b88b06ebdc3dc2165888f3d Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Tue, 25 Apr 2017 16:52:29 +0200 Subject: [PATCH] Use factories for all factory associations. --- test/factories/changeset_tags.rb | 3 +-- test/factories/old_node.rb | 4 +--- test/factories/old_node_tags.rb | 4 +--- test/factories/old_relation_tags.rb | 4 +--- test/factories/old_way_tags.rb | 4 +--- test/factories/relation_tags.rb | 3 +-- test/factories/user_blocks.rb | 3 +-- test/factories/way_tags.rb | 3 +-- 8 files changed, 8 insertions(+), 20 deletions(-) diff --git a/test/factories/changeset_tags.rb b/test/factories/changeset_tags.rb index fa728f085..d80f29c7a 100644 --- a/test/factories/changeset_tags.rb +++ b/test/factories/changeset_tags.rb @@ -3,7 +3,6 @@ FactoryGirl.define do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } - # Fixme requires changeset factory - changeset_id 1 + changeset end end diff --git a/test/factories/old_node.rb b/test/factories/old_node.rb index 403ffc0ea..3eda91a53 100644 --- a/test/factories/old_node.rb +++ b/test/factories/old_node.rb @@ -4,9 +4,7 @@ FactoryGirl.define do longitude 1 * GeoRecord::SCALE changeset - - # FIXME: needs node factory - node_id 1000 + association :current_node, :factory => :node visible true timestamp Time.now diff --git a/test/factories/old_node_tags.rb b/test/factories/old_node_tags.rb index 5c63f3242..f74e80702 100644 --- a/test/factories/old_node_tags.rb +++ b/test/factories/old_node_tags.rb @@ -3,8 +3,6 @@ FactoryGirl.define do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } - # Fixme requires old_node factory - node_id 1 - version 1 + old_node end end diff --git a/test/factories/old_relation_tags.rb b/test/factories/old_relation_tags.rb index 08e417187..0a83cc6d7 100644 --- a/test/factories/old_relation_tags.rb +++ b/test/factories/old_relation_tags.rb @@ -3,8 +3,6 @@ FactoryGirl.define do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } - # Fixme requires old_relation factory - relation_id 1 - version 1 + old_relation end end diff --git a/test/factories/old_way_tags.rb b/test/factories/old_way_tags.rb index c639c06db..6b3e6cf47 100644 --- a/test/factories/old_way_tags.rb +++ b/test/factories/old_way_tags.rb @@ -3,8 +3,6 @@ FactoryGirl.define do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } - # Fixme requires old_way factory - way_id 1 - version 1 + old_way end end diff --git a/test/factories/relation_tags.rb b/test/factories/relation_tags.rb index 00ad4dbdc..7fe71448d 100644 --- a/test/factories/relation_tags.rb +++ b/test/factories/relation_tags.rb @@ -3,7 +3,6 @@ FactoryGirl.define do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } - # Fixme requires relation factory - relation_id 1 + relation end end diff --git a/test/factories/user_blocks.rb b/test/factories/user_blocks.rb index 8f7edaf6e..f1ef5b65b 100644 --- a/test/factories/user_blocks.rb +++ b/test/factories/user_blocks.rb @@ -15,8 +15,7 @@ FactoryGirl.define do end trait :revoked do - # FIXME: requires User factory - revoker_id 5 + association :revoker, :factory => :moderator_user end end end diff --git a/test/factories/way_tags.rb b/test/factories/way_tags.rb index 3bc3192f5..7a60aeea6 100644 --- a/test/factories/way_tags.rb +++ b/test/factories/way_tags.rb @@ -3,7 +3,6 @@ FactoryGirl.define do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } - # Fixme requires way factory - way_id 1 + way end end -- 2.39.5