1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-12-01 05:43:04 +00:00

renaming factory girl => factory bot

هذا الالتزام موجود في:
Adam Cooke
2019-03-14 10:45:08 +00:00
الأصل 145a5f3cba
التزام f56dac2284
8 ملفات معدلة مع 26 إضافات و26 حذوفات

عرض الملف

@@ -46,6 +46,6 @@ group :development do
gem 'annotate' gem 'annotate'
gem 'rspec' gem 'rspec'
gem 'rspec-rails' gem 'rspec-rails'
gem "factory_girl_rails", "~> 4.0" gem "factory_bot_rails", "~> 4.0"
gem "database_cleaner" gem "database_cleaner"
end end

عرض الملف

@@ -84,10 +84,10 @@ GEM
encrypto_signo (1.0.0) encrypto_signo (1.0.0)
erubi (1.8.0) erubi (1.8.0)
execjs (2.7.0) execjs (2.7.0)
factory_girl (4.9.0) factory_bot (4.11.1)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (4.9.0) factory_bot_rails (4.11.1)
factory_girl (~> 4.9.0) factory_bot (~> 4.11.1)
railties (>= 3.0.0) railties (>= 3.0.0)
faraday (0.15.2) faraday (0.15.2)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
@@ -262,7 +262,7 @@ DEPENDENCIES
database_cleaner database_cleaner
dynamic_form dynamic_form
encrypto_signo encrypto_signo
factory_girl_rails (~> 4.0) factory_bot_rails (~> 4.0)
foreman foreman
gelf gelf
haml haml

عرض الملف

@@ -34,13 +34,13 @@
# index_domains_on_uuid (uuid) # index_domains_on_uuid (uuid)
# #
FactoryGirl.define do FactoryBot.define do
factory :domain do factory :domain do
association :owner, :factory => :user association :owner, :factory => :user
sequence(:name) { |n| "example#{n}.com" } sequence(:name) { |n| "example#{n}.com" }
verification_method 'DNS' verification_method { 'DNS' }
verified_at Time.now verified_at { Time.now }
end end
factory :organization_domain, :parent => :domain do factory :organization_domain, :parent => :domain do

عرض الملف

@@ -21,10 +21,10 @@
# index_organizations_on_uuid (uuid) # index_organizations_on_uuid (uuid)
# #
FactoryGirl.define do FactoryBot.define do
factory :organization do factory :organization do
name "Acme Inc" name { "Acme Inc" }
sequence(:permalink) { |n| "org#{n}" } sequence(:permalink) { |n| "org#{n}" }
association :owner, :factory => :user association :owner, :factory => :user
end end

عرض الملف

@@ -39,13 +39,13 @@
# index_servers_on_uuid (uuid) # index_servers_on_uuid (uuid)
# #
FactoryGirl.define do FactoryBot.define do
factory :server do factory :server do
association :organization association :organization
name "Mail Server" name { "Mail Server" }
mode "Live" mode { "Live" }
provision_database false provision_database { false }
sequence(:permalink) { |n| "server#{n}" } sequence(:permalink) { |n| "server#{n}" }
end end

عرض الملف

@@ -18,11 +18,11 @@
# excluded_click_domains :text(65535) # excluded_click_domains :text(65535)
# #
FactoryGirl.define do FactoryBot.define do
factory :track_domain do factory :track_domain do
name "click" name { "click" }
dns_status 'OK' dns_status { 'OK' }
association :server association :server
after(:build) do |track_domain| after(:build) do |track_domain|

عرض الملف

@@ -23,13 +23,13 @@
# index_users_on_uuid (uuid) # index_users_on_uuid (uuid)
# #
FactoryGirl.define do FactoryBot.define do
factory :user do factory :user do
first_name "John" first_name { "John" }
last_name "Doe" last_name { "Doe" }
password "passw0rd" password { "passw0rd" }
email_verified_at Time.now email_verified_at { Time.now }
sequence(:email_address) { |n| "user#{n}@example.com" } sequence(:email_address) { |n| "user#{n}@example.com" }
end end

عرض الملف

@@ -3,7 +3,7 @@ ENV['POSTAL_CONFIG_ROOT'] = File.expand_path('../config', __FILE__)
require File.expand_path('../../config/environment', __FILE__) require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails' require 'rspec/rails'
require 'spec_helper' require 'spec_helper'
require 'factory_girl' require 'factory_bot'
require 'database_cleaner' require 'database_cleaner'
FACTORIES_EXCLUDED_FROM_LINT = [] FACTORIES_EXCLUDED_FROM_LINT = []
@@ -13,7 +13,7 @@ ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config| RSpec.configure do |config|
config.use_transactional_fixtures = true config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location! config.infer_spec_type_from_file_location!
config.include FactoryGirl::Syntax::Methods config.include FactoryBot::Syntax::Methods
config.include Postal::RspecHelpers config.include Postal::RspecHelpers
config.before(:suite) do config.before(:suite) do
@@ -21,7 +21,7 @@ RSpec.configure do |config|
# the rest of the suite. # the rest of the suite.
begin begin
DatabaseCleaner.start 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 ensure
DatabaseCleaner.clean DatabaseCleaner.clean
end end
@@ -30,7 +30,7 @@ RSpec.configure do |config|
# Because the mail databases don't use any transactions, all data left in the # Because the mail databases don't use any transactions, all data left in the
# database will be left there unless removed. # database will be left there unless removed.
DatabaseCleaner.start DatabaseCleaner.start
GLOBAL_SERVER = FactoryGirl.create(:server, :provision_database => true) GLOBAL_SERVER = FactoryBot.create(:server, :provision_database => true)
end end
config.after(:suite) do config.after(:suite) do