diff options
author | Azul <azul@riseup.net> | 2017-12-08 18:27:24 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2017-12-08 21:33:09 +0100 |
commit | d839bed40fb7901ea88395d4ba06e58f4b3cc88a (patch) | |
tree | 5939690ac0f0f2226459aa9412a80292515ebae2 /test/support/stub_record_helper.rb | |
parent | ff8b2635c308d45ec38fd4eed257db7da9b3c4b0 (diff) |
upgrade: factory_girl -> factory_bot
Diffstat (limited to 'test/support/stub_record_helper.rb')
-rw-r--r-- | test/support/stub_record_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |