This is now build-in into factory_bot_rails https://github.com/thoughtbot/factory_bot_rails/pull/427/files
In FactoryBot factories, Rails' file_fixture is not available by default. To enable it, include a support module from rspec-rails:
FactoryBot::SyntaxRunner.include(RSpec::Rails::FileFixtureSupport)
That includes ActiveSupport::Testing::FileFixtures, where file_fixture is defined, but also configures the file_fixture_path so that you can actually use file_fixture.
Posted by Arne Hartherz to makandra dev (2024-12-10 08:28)