From d839bed40fb7901ea88395d4ba06e58f4b3cc88a Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 8 Dec 2017 18:27:24 +0100 Subject: upgrade: factory_girl -> factory_bot --- test/support/stub_record_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/support/stub_record_helper.rb') diff --git a/test/support/stub_record_helper.rb b/test/support/stub_record_helper.rb index 25138a0..4d74f2a 100644 --- a/test/support/stub_record_helper.rb +++ b/test/support/stub_record_helper.rb @@ -26,7 +26,7 @@ module StubRecordHelper if record_or_method_hash && !record_or_method_hash.is_a?(Hash) return record_or_method_hash end - FactoryGirl.build_stubbed(factory).tap do |record| + FactoryBot.build_stubbed(factory).tap do |record| if persisted or record.persisted? record_or_method_hash.reverse_merge! :created_at => Time.now, :updated_at => Time.now, :id => Random.rand(100000).to_s @@ -38,7 +38,7 @@ module StubRecordHelper # returns deep stringified attributes so they can be compared to # what the controller receives as params def record_attributes_for(factory, attribs_hash = nil) - FactoryGirl.attributes_for(factory, attribs_hash).tap do |attribs| + FactoryBot.attributes_for(factory, attribs_hash).tap do |attribs| attribs.keys.each do |key| val = attribs.delete(key) attribs[key.to_s] = val.is_a?(Hash) ? val.stringify_keys! : val -- cgit v1.2.3