0

I have the following factory:

FactoryBot.define do
  factory :checkin do
    image { Rack::Test::UploadedFile.new( File.join(Rails.root, "spec", "support", "images", "single.jpg")) }
  end
end

and I'm getting the following error/warning that I would like to fix:

WARN: Job arguments to CarrierWave::Workers::ProcessAsset do not serialize to JSON safely. This will raise an error in
Sidekiq 7.0. See https://github.com/mperham/sidekiq/wiki/Best-Practices or raise an error today
by calling `Sidekiq.strict_args!` during Sidekiq initialization.

How can I convert the image to be a string and still work with my specs?

Kamilski81
  • 14,409
  • 33
  • 108
  • 161
  • 1
    I think you might just need to wrap the File.join() command with File.open() much like the answer here: https://stackoverflow.com/a/41054559/2029868 – cal1801 Feb 24 '23 at 19:53

0 Answers0