From b2fa94750221ec316eb6c5244ca66543f321538c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 29 Oct 2017 19:29:30 +0000 Subject: [PATCH] Replace factory_girl with factory_bot --- Gemfile | 2 +- Gemfile.lock | 8 ++++---- test/factories/acls.rb | 2 +- test/factories/changeset_comments.rb | 2 +- test/factories/changeset_tags.rb | 2 +- test/factories/changesets.rb | 2 +- test/factories/client_applications.rb | 2 +- test/factories/diary_comments.rb | 2 +- test/factories/diary_entries.rb | 2 +- test/factories/friends.rb | 2 +- test/factories/languages.rb | 2 +- test/factories/messages.rb | 2 +- test/factories/node.rb | 2 +- test/factories/node_tags.rb | 2 +- test/factories/note_comments.rb | 2 +- test/factories/notes.rb | 2 +- test/factories/old_node.rb | 2 +- test/factories/old_node_tags.rb | 2 +- test/factories/old_relation.rb | 2 +- test/factories/old_relation_member.rb | 2 +- test/factories/old_relation_tags.rb | 2 +- test/factories/old_way.rb | 2 +- test/factories/old_way_node.rb | 2 +- test/factories/old_way_tags.rb | 2 +- test/factories/redaction.rb | 2 +- test/factories/relation.rb | 2 +- test/factories/relation_member.rb | 2 +- test/factories/relation_tags.rb | 2 +- test/factories/tracepoints.rb | 2 +- test/factories/traces.rb | 2 +- test/factories/tracetags.rb | 2 +- test/factories/user.rb | 2 +- test/factories/user_blocks.rb | 2 +- test/factories/user_preferences.rb | 2 +- test/factories/user_role.rb | 2 +- test/factories/way.rb | 2 +- test/factories/way_node.rb | 2 +- test/factories/way_tags.rb | 2 +- test/test_helper.rb | 2 +- 39 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Gemfile b/Gemfile index 79bc0d10e..fee5fa4d1 100644 --- a/Gemfile +++ b/Gemfile @@ -120,7 +120,7 @@ end # Needed in development as well so rake can see konacha tasks group :development, :test do gem "coveralls", :require => false - gem "factory_girl_rails" + gem "factory_bot_rails" gem "jshint" # gem "konacha" gem "poltergeist" diff --git a/Gemfile.lock b/Gemfile.lock index 653098e8e..244bd8a73 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -90,10 +90,10 @@ GEM erubi (1.6.1) execjs (2.7.0) exifr (1.3.2) - factory_girl (4.8.1) + factory_bot (4.8.2) activesupport (>= 3.0.0) - factory_girl_rails (4.8.0) - factory_girl (~> 4.8.0) + factory_bot_rails (4.8.2) + factory_bot (~> 4.8.2) railties (>= 3.0.0) faraday (0.12.2) multipart-post (>= 1.2, < 3) @@ -363,7 +363,7 @@ DEPENDENCIES coveralls dalli dynamic_form - factory_girl_rails + factory_bot_rails faraday geoip htmlentities diff --git a/test/factories/acls.rb b/test/factories/acls.rb index 3f91df3ab..384fea9c1 100644 --- a/test/factories/acls.rb +++ b/test/factories/acls.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :acl do sequence(:k) { |n| "Key #{n}" } end diff --git a/test/factories/changeset_comments.rb b/test/factories/changeset_comments.rb index 04644580f..fb3eef895 100644 --- a/test/factories/changeset_comments.rb +++ b/test/factories/changeset_comments.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :changeset_comment do sequence(:body) { |n| "Changeset comment #{n}" } visible true diff --git a/test/factories/changeset_tags.rb b/test/factories/changeset_tags.rb index d80f29c7a..633dd0005 100644 --- a/test/factories/changeset_tags.rb +++ b/test/factories/changeset_tags.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :changeset_tag do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } diff --git a/test/factories/changesets.rb b/test/factories/changesets.rb index 01d357198..f42242e78 100644 --- a/test/factories/changesets.rb +++ b/test/factories/changesets.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :changeset do created_at Time.now.utc closed_at Time.now.utc + 1.day diff --git a/test/factories/client_applications.rb b/test/factories/client_applications.rb index 5535ee2e7..c2dbf7fa2 100644 --- a/test/factories/client_applications.rb +++ b/test/factories/client_applications.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :client_application do sequence(:name) { |n| "Client application #{n}" } sequence(:url) { |n| "http://example.com/app/#{n}" } diff --git a/test/factories/diary_comments.rb b/test/factories/diary_comments.rb index 2d54f273e..cb5f8eebd 100644 --- a/test/factories/diary_comments.rb +++ b/test/factories/diary_comments.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :diary_comment do sequence(:body) { |n| "This is diary comment #{n}" } diff --git a/test/factories/diary_entries.rb b/test/factories/diary_entries.rb index 666a37ee8..4319f2a63 100644 --- a/test/factories/diary_entries.rb +++ b/test/factories/diary_entries.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :diary_entry do sequence(:title) { |n| "Diary entry #{n}" } sequence(:body) { |n| "This is diary entry #{n}" } diff --git a/test/factories/friends.rb b/test/factories/friends.rb index 749846edb..15317ee0c 100644 --- a/test/factories/friends.rb +++ b/test/factories/friends.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :friend do association :befriender, :factory => :user association :befriendee, :factory => :user diff --git a/test/factories/languages.rb b/test/factories/languages.rb index 0887c9129..ddf4588e9 100644 --- a/test/factories/languages.rb +++ b/test/factories/languages.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :language do code "en" english_name "English" diff --git a/test/factories/messages.rb b/test/factories/messages.rb index 9d9c30a48..ece10ae72 100644 --- a/test/factories/messages.rb +++ b/test/factories/messages.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :message do sequence(:title) { |n| "Message #{n}" } sequence(:body) { |n| "Body text for message #{n}" } diff --git a/test/factories/node.rb b/test/factories/node.rb index bcc1fdbe8..d849755cd 100644 --- a/test/factories/node.rb +++ b/test/factories/node.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :node do latitude 1 * GeoRecord::SCALE longitude 1 * GeoRecord::SCALE diff --git a/test/factories/node_tags.rb b/test/factories/node_tags.rb index 0a10fc65d..359af8631 100644 --- a/test/factories/node_tags.rb +++ b/test/factories/node_tags.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :node_tag do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } diff --git a/test/factories/note_comments.rb b/test/factories/note_comments.rb index b06dc378a..d3fb3ce96 100644 --- a/test/factories/note_comments.rb +++ b/test/factories/note_comments.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :note_comment do sequence(:body) { |n| "This is note comment #{n}" } visible true diff --git a/test/factories/notes.rb b/test/factories/notes.rb index 9dbcdf58c..56a9541dc 100644 --- a/test/factories/notes.rb +++ b/test/factories/notes.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :note do latitude 1 * GeoRecord::SCALE longitude 1 * GeoRecord::SCALE diff --git a/test/factories/old_node.rb b/test/factories/old_node.rb index 3eda91a53..089363397 100644 --- a/test/factories/old_node.rb +++ b/test/factories/old_node.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :old_node do latitude 1 * GeoRecord::SCALE longitude 1 * GeoRecord::SCALE diff --git a/test/factories/old_node_tags.rb b/test/factories/old_node_tags.rb index f74e80702..37e755ec2 100644 --- a/test/factories/old_node_tags.rb +++ b/test/factories/old_node_tags.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :old_node_tag do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } diff --git a/test/factories/old_relation.rb b/test/factories/old_relation.rb index c4b29fad4..a6e87a38b 100644 --- a/test/factories/old_relation.rb +++ b/test/factories/old_relation.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :old_relation do timestamp Time.now visible true diff --git a/test/factories/old_relation_member.rb b/test/factories/old_relation_member.rb index ad7eeb078..524a71074 100644 --- a/test/factories/old_relation_member.rb +++ b/test/factories/old_relation_member.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :old_relation_member do member_role "" diff --git a/test/factories/old_relation_tags.rb b/test/factories/old_relation_tags.rb index 0a83cc6d7..4a3a1c01c 100644 --- a/test/factories/old_relation_tags.rb +++ b/test/factories/old_relation_tags.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :old_relation_tag do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } diff --git a/test/factories/old_way.rb b/test/factories/old_way.rb index a7d5bdbe8..a57ccb713 100644 --- a/test/factories/old_way.rb +++ b/test/factories/old_way.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :old_way do timestamp Time.now visible true diff --git a/test/factories/old_way_node.rb b/test/factories/old_way_node.rb index ac6546293..0a544aaf7 100644 --- a/test/factories/old_way_node.rb +++ b/test/factories/old_way_node.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :old_way_node do sequence_id 1 diff --git a/test/factories/old_way_tags.rb b/test/factories/old_way_tags.rb index 6b3e6cf47..2e5138b6b 100644 --- a/test/factories/old_way_tags.rb +++ b/test/factories/old_way_tags.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :old_way_tag do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } diff --git a/test/factories/redaction.rb b/test/factories/redaction.rb index 0ee5f1963..3304af899 100644 --- a/test/factories/redaction.rb +++ b/test/factories/redaction.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :redaction do sequence(:title) { |n| "Redaction #{n}" } sequence(:description) { |n| "Description of redaction #{n}" } diff --git a/test/factories/relation.rb b/test/factories/relation.rb index 44f18f491..c4c947a4f 100644 --- a/test/factories/relation.rb +++ b/test/factories/relation.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :relation do timestamp Time.now visible true diff --git a/test/factories/relation_member.rb b/test/factories/relation_member.rb index b3f69e3e9..4357f3de7 100644 --- a/test/factories/relation_member.rb +++ b/test/factories/relation_member.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :relation_member do member_role "" diff --git a/test/factories/relation_tags.rb b/test/factories/relation_tags.rb index 7fe71448d..074ab93f4 100644 --- a/test/factories/relation_tags.rb +++ b/test/factories/relation_tags.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :relation_tag do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } diff --git a/test/factories/tracepoints.rb b/test/factories/tracepoints.rb index c47b7932d..ad520ea1f 100644 --- a/test/factories/tracepoints.rb +++ b/test/factories/tracepoints.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :tracepoint do trackid 1 latitude 1 * GeoRecord::SCALE diff --git a/test/factories/traces.rb b/test/factories/traces.rb index 76fd90590..efc1180cd 100644 --- a/test/factories/traces.rb +++ b/test/factories/traces.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :trace do sequence(:name) { |n| "Trace #{n}.gpx" } sequence(:description) { |n| "This is trace #{n}" } diff --git a/test/factories/tracetags.rb b/test/factories/tracetags.rb index 3dbeeb877..2db07c3b7 100644 --- a/test/factories/tracetags.rb +++ b/test/factories/tracetags.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :tracetag do sequence(:tag) { |n| "Tag #{n}" } diff --git a/test/factories/user.rb b/test/factories/user.rb index 8fe768410..d6ee1fa8c 100644 --- a/test/factories/user.rb +++ b/test/factories/user.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :user do sequence(:email) { |n| "user#{n}@example.com" } sequence(:display_name) { |n| "User #{n}" } diff --git a/test/factories/user_blocks.rb b/test/factories/user_blocks.rb index f1ef5b65b..d206511b4 100644 --- a/test/factories/user_blocks.rb +++ b/test/factories/user_blocks.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :user_block do sequence(:reason) { |n| "User Block #{n}" } ends_at Time.now + 1.day diff --git a/test/factories/user_preferences.rb b/test/factories/user_preferences.rb index e6f0d6b87..6d33e8caa 100644 --- a/test/factories/user_preferences.rb +++ b/test/factories/user_preferences.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :user_preference do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } diff --git a/test/factories/user_role.rb b/test/factories/user_role.rb index 0eea25cee..6523342f7 100644 --- a/test/factories/user_role.rb +++ b/test/factories/user_role.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :user_role do user association :granter, :factory => :user diff --git a/test/factories/way.rb b/test/factories/way.rb index 1c31de3d0..68826e919 100644 --- a/test/factories/way.rb +++ b/test/factories/way.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :way do timestamp Time.now visible true diff --git a/test/factories/way_node.rb b/test/factories/way_node.rb index 203c055a7..770de02d9 100644 --- a/test/factories/way_node.rb +++ b/test/factories/way_node.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :way_node do sequence_id 1 diff --git a/test/factories/way_tags.rb b/test/factories/way_tags.rb index 7a60aeea6..8345ec698 100644 --- a/test/factories/way_tags.rb +++ b/test/factories/way_tags.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :way_tag do sequence(:k) { |n| "Key #{n}" } sequence(:v) { |n| "Value #{n}" } diff --git a/test/test_helper.rb b/test/test_helper.rb index d41a369f8..70f69a3ae 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -8,7 +8,7 @@ require "webmock/minitest" module ActiveSupport class TestCase - include FactoryGirl::Syntax::Methods + include FactoryBot::Syntax::Methods ## # takes a block which is executed in the context of a different -- 2.39.5