scinote-web/spec/factories/assets.rb

10 lines
230 B
Ruby
Raw Normal View History

2019-05-06 20:12:45 +08:00
# frozen_string_literal: true
FactoryBot.define do
2017-07-28 16:14:50 +08:00
factory :asset do
after(:create) do |asset|
asset.file.attach(io: File.open(Rails.root.join('spec/fixtures/files/test.jpg')), filename: 'test.jpg')
end
2017-07-28 16:14:50 +08:00
end
end