diff --git a/Gemfile b/Gemfile index 0ef4bdd..c1607e5 100644 --- a/Gemfile +++ b/Gemfile @@ -46,6 +46,6 @@ group :development do gem 'annotate' gem 'rspec' gem 'rspec-rails' - gem "factory_girl_rails", "~> 4.0" + gem "factory_bot_rails", "~> 4.0" gem "database_cleaner" end diff --git a/Gemfile.lock b/Gemfile.lock index 2dbdd01..1e0a1b5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -84,10 +84,10 @@ GEM encrypto_signo (1.0.0) erubi (1.8.0) execjs (2.7.0) - factory_girl (4.9.0) + factory_bot (4.11.1) activesupport (>= 3.0.0) - factory_girl_rails (4.9.0) - factory_girl (~> 4.9.0) + factory_bot_rails (4.11.1) + factory_bot (~> 4.11.1) railties (>= 3.0.0) faraday (0.15.2) multipart-post (>= 1.2, < 3) @@ -262,7 +262,7 @@ DEPENDENCIES database_cleaner dynamic_form encrypto_signo - factory_girl_rails (~> 4.0) + factory_bot_rails (~> 4.0) foreman gelf haml diff --git a/spec/factories/domain_factory.rb b/spec/factories/domain_factory.rb index ca04721..aa51b96 100644 --- a/spec/factories/domain_factory.rb +++ b/spec/factories/domain_factory.rb @@ -34,13 +34,13 @@ # index_domains_on_uuid (uuid) # -FactoryGirl.define do +FactoryBot.define do factory :domain do association :owner, :factory => :user sequence(:name) { |n| "example#{n}.com" } - verification_method 'DNS' - verified_at Time.now + verification_method { 'DNS' } + verified_at { Time.now } end factory :organization_domain, :parent => :domain do diff --git a/spec/factories/organization_factory.rb b/spec/factories/organization_factory.rb index fd130c6..86d9172 100644 --- a/spec/factories/organization_factory.rb +++ b/spec/factories/organization_factory.rb @@ -21,10 +21,10 @@ # index_organizations_on_uuid (uuid) # -FactoryGirl.define do +FactoryBot.define do factory :organization do - name "Acme Inc" + name { "Acme Inc" } sequence(:permalink) { |n| "org#{n}" } association :owner, :factory => :user end diff --git a/spec/factories/server_factory.rb b/spec/factories/server_factory.rb index 08dba60..acff5b6 100644 --- a/spec/factories/server_factory.rb +++ b/spec/factories/server_factory.rb @@ -39,13 +39,13 @@ # index_servers_on_uuid (uuid) # -FactoryGirl.define do +FactoryBot.define do factory :server do association :organization - name "Mail Server" - mode "Live" - provision_database false + name { "Mail Server" } + mode { "Live" } + provision_database { false } sequence(:permalink) { |n| "server#{n}" } end diff --git a/spec/factories/track_domain_factory.rb b/spec/factories/track_domain_factory.rb index affb416..125c7ee 100644 --- a/spec/factories/track_domain_factory.rb +++ b/spec/factories/track_domain_factory.rb @@ -18,11 +18,11 @@ # excluded_click_domains :text(65535) # -FactoryGirl.define do +FactoryBot.define do factory :track_domain do - name "click" - dns_status 'OK' + name { "click" } + dns_status { 'OK' } association :server after(:build) do |track_domain| diff --git a/spec/factories/user_factory.rb b/spec/factories/user_factory.rb index cdde493..42d7b2a 100644 --- a/spec/factories/user_factory.rb +++ b/spec/factories/user_factory.rb @@ -23,13 +23,13 @@ # index_users_on_uuid (uuid) # -FactoryGirl.define do +FactoryBot.define do factory :user do - first_name "John" - last_name "Doe" - password "passw0rd" - email_verified_at Time.now + first_name { "John" } + last_name { "Doe" } + password { "passw0rd" } + email_verified_at { Time.now } sequence(:email_address) { |n| "user#{n}@example.com" } end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index a9e3c2b..4a2dd7b 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -3,7 +3,7 @@ ENV['POSTAL_CONFIG_ROOT'] = File.expand_path('../config', __FILE__) require File.expand_path('../../config/environment', __FILE__) require 'rspec/rails' require 'spec_helper' -require 'factory_girl' +require 'factory_bot' require 'database_cleaner' FACTORIES_EXCLUDED_FROM_LINT = [] @@ -13,7 +13,7 @@ ActiveRecord::Migration.maintain_test_schema! RSpec.configure do |config| config.use_transactional_fixtures = true config.infer_spec_type_from_file_location! - config.include FactoryGirl::Syntax::Methods + config.include FactoryBot::Syntax::Methods config.include Postal::RspecHelpers config.before(:suite) do @@ -21,7 +21,7 @@ RSpec.configure do |config| # the rest of the suite. begin DatabaseCleaner.start - FactoryGirl.lint(FactoryGirl.factories.select { |f| !FACTORIES_EXCLUDED_FROM_LINT.include?(f.name.to_sym) }) + FactoryBot.lint(FactoryBot.factories.select { |f| !FACTORIES_EXCLUDED_FROM_LINT.include?(f.name.to_sym) }) ensure DatabaseCleaner.clean end @@ -30,7 +30,7 @@ RSpec.configure do |config| # Because the mail databases don't use any transactions, all data left in the # database will be left there unless removed. DatabaseCleaner.start - GLOBAL_SERVER = FactoryGirl.create(:server, :provision_database => true) + GLOBAL_SERVER = FactoryBot.create(:server, :provision_database => true) end config.after(:suite) do