diff --git a/Gemfile b/Gemfile index 832259b..ad8106f 100644 --- a/Gemfile +++ b/Gemfile @@ -64,7 +64,7 @@ group :development, :test do gem 'byebug' # Yay tests gem 'rspec-rails' - gem 'factory_girl_rails' + gem 'factory_bot_rails' gem 'faker' gem 'listen' end diff --git a/Gemfile.lock b/Gemfile.lock index 66e265b..5d1cf0b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -112,11 +112,11 @@ GEM erubi (1.7.1) erubis (2.7.0) execjs (2.7.0) - factory_girl (4.9.0) - activesupport (>= 3.0.0) - factory_girl_rails (4.9.0) - factory_girl (~> 4.9.0) - railties (>= 3.0.0) + factory_bot (5.0.2) + activesupport (>= 4.2.0) + factory_bot_rails (5.0.2) + factory_bot (~> 5.0.2) + railties (>= 4.2.0) faker (1.8.7) i18n (>= 0.7) faraday (0.12.2) @@ -359,7 +359,7 @@ DEPENDENCIES coveralls devise ed25519 - factory_girl_rails + factory_bot_rails faker friendly_id (~> 5.1.0) haml-rails diff --git a/lib/tasks/devseed.rake b/lib/tasks/devseed.rake index 6708eeb..63b5d2f 100644 --- a/lib/tasks/devseed.rake +++ b/lib/tasks/devseed.rake @@ -1,16 +1,16 @@ unless Rails.env.production? - require 'factory_girl' + require 'factory_bot' require 'faker' task :sow => :environment do - users = FactoryGirl.create_list(:user, 20) + users = FactoryBot.create_list(:user, 20) 100.times do sample_users = users.sample(2) - FactoryGirl.create :transaction, debtor: sample_users[0], creditor: sample_users[1] + FactoryBot.create :transaction, debtor: sample_users[0], creditor: sample_users[1] end - clients = FactoryGirl.create_list(:client, 5) + clients = FactoryBot.create_list(:client, 5) 100.times do debtor, creditor = users.sample(2) - FactoryGirl.create :client_transaction, issuer: clients.sample, debtor: debtor, creditor: creditor + FactoryBot.create :client_transaction, issuer: clients.sample, debtor: debtor, creditor: creditor end end end diff --git a/spec/factories/android_device_registration_tokens.rb b/spec/factories/android_device_registration_tokens.rb index 6d17a2c..ae468c8 100644 --- a/spec/factories/android_device_registration_tokens.rb +++ b/spec/factories/android_device_registration_tokens.rb @@ -1,6 +1,6 @@ -FactoryGirl.define do +FactoryBot.define do factory :android_device_registration_token do - token "MyString" - user nil + token { Faker::Lorem.word } + association :user end end diff --git a/spec/factories/clients.rb b/spec/factories/clients.rb index 5926219..db8966e 100644 --- a/spec/factories/clients.rb +++ b/spec/factories/clients.rb @@ -9,7 +9,7 @@ # updated_at :datetime not null # -FactoryGirl.define do +FactoryBot.define do factory :client do name { Faker::Lorem.word } end diff --git a/spec/factories/notifications.rb b/spec/factories/notifications.rb index 20df5f0..f47d9e9 100644 --- a/spec/factories/notifications.rb +++ b/spec/factories/notifications.rb @@ -10,7 +10,7 @@ # updated_at :datetime not null # -FactoryGirl.define do +FactoryBot.define do factory :notification do end diff --git a/spec/factories/requests.rb b/spec/factories/requests.rb index 8193437..0dba536 100644 --- a/spec/factories/requests.rb +++ b/spec/factories/requests.rb @@ -14,7 +14,7 @@ # updated_at :datetime not null # -FactoryGirl.define do +FactoryBot.define do factory :request do end diff --git a/spec/factories/roles.rb b/spec/factories/roles.rb index 3ae14f9..b206918 100644 --- a/spec/factories/roles.rb +++ b/spec/factories/roles.rb @@ -1,4 +1,4 @@ -FactoryGirl.define do +FactoryBot.define do factory :role do end diff --git a/spec/factories/transactions.rb b/spec/factories/transactions.rb index 23de4b8..1ea588c 100644 --- a/spec/factories/transactions.rb +++ b/spec/factories/transactions.rb @@ -14,7 +14,7 @@ # id_at_client :integer # -FactoryGirl.define do +FactoryBot.define do factory :transaction do association :debtor, factory: :user association :creditor, factory: :user diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 7eafbf5..d18342e 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -10,12 +10,12 @@ # updated_at :datetime not null # -FactoryGirl.define do +FactoryBot.define do factory :user do name { Faker::Internet.user_name } factory :penning do - penning true + penning { true } end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0361e72..df85706 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -22,7 +22,7 @@ Coveralls.wear!('rails') # users commonly want. # # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -require 'factory_girl' +require 'factory_bot' require 'devise' Dir[File.join(File.dirname(__FILE__), 'support', '**', '*.rb')].each do |f| @@ -30,7 +30,7 @@ Dir[File.join(File.dirname(__FILE__), 'support', '**', '*.rb')].each do |f| end RSpec.configure do |config| - config.include FactoryGirl::Syntax::Methods + config.include FactoryBot::Syntax::Methods config.include Devise::TestHelpers, type: :controller # rspec-expectations config goes here. You can use an alternate