diff options
Diffstat (limited to 'spec/support/factory_bot.rb')
-rw-r--r-- | spec/support/factory_bot.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/support/factory_bot.rb b/spec/support/factory_bot.rb index 5761e05d541..5f22fa11e9e 100644 --- a/spec/support/factory_bot.rb +++ b/spec/support/factory_bot.rb @@ -2,6 +2,14 @@ FactoryBot::SyntaxRunner.class_eval do include RSpec::Mocks::ExampleMethods + + # FactoryBot doesn't allow yet to add a helper that can be used in factories + # While the fixture_file_upload helper is reasonable to be used there: + # + # https://github.com/thoughtbot/factory_bot/issues/564#issuecomment-389491577 + def fixture_file_upload(*args, **kwargs) + Rack::Test::UploadedFile.new(*args, **kwargs) + end end # Patching FactoryBot to allow stubbing non AR models |