rename factory_girl_(rails) to factory_bot_(rails)
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
def find_factories_by_class(klass)
|
||||
FactoryGirl.factories.select do |factory|
|
||||
FactoryBot.factories.select do |factory|
|
||||
factory.instance_variable_get(:@class_name) == klass || factory.instance_variable_get(:@name) == klass.model_name.singular.to_sym
|
||||
end
|
||||
end
|
||||
@ -9,7 +9,7 @@ module ActiveRecord
|
||||
[:build, :create].each do |strategy|
|
||||
define_singleton_method("#{strategy}_factories") do |attributes = {}|
|
||||
find_factories_by_class(self).map(&:name).map do |factory_name|
|
||||
FactoryGirl.send(strategy, factory_name, attributes)
|
||||
FactoryBot.send(strategy, factory_name, attributes)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user