title: How to use FactoryBot in ActionMailer::Preview
body: <p>I used to have the following</p>
  
  <pre><code>require 'factory_girl'
  require_relative '../../support/factories/users.rb'
  
  class UserMailerPreview &lt; ActionMailer::Preview
    def invitation
      user = FactoryGirl.build(:user)
      UserMailer.invitation(user)
    end
  end
  </code></pre>
  
  <p>and it was working with FactoryGirl 4.8</p>
  
  <p>Now, I have updated to FactoryBot 4.8.2</p>
  
  <pre><code>    require 'factory_bot'
      require_relative '../../support/factories/users.rb'
  
      class UserMailerPreview &lt; ActionMailer::Preview
        def invitation
          user = FactoryBot.build(:user)
          UserMailer.invitation(user)
        end
      end
  </code></pre>
  
  <p>But I get <code>No such file to load -- factory_bot.rb</code>. What should I require?</p>
  
  <p>Thanks for the help.</p>