houdini/spec/support/factory_bot.rb

12 lines
237 B
Ruby

module FactoryBotExtensions
def force_create(name, args={})
v = build(name, args)
v.save(validate:false)
v
end
end
RSpec.configure do |config|
config.include FactoryBot::Syntax::Methods
config.include FactoryBotExtensions
end