Ruby on rails 轨道4+;Rspec+;Carrierwave:Carrierwave期望属性是哪个类的实例?

Ruby on rails 轨道4+;Rspec+;Carrierwave:Carrierwave期望属性是哪个类的实例?,ruby-on-rails,Ruby On Rails,这是我使用CarrierWave的模型: class UploadedPrescription < ActiveRecord::Base mount_uploader :file, FileUploader belongs_to :order validates_presence_of :file end 你有没有试着传递一个文件。打开(路径到文件)?是的,谢谢 u = UploadedPrescription.new(file: ??what do i put her

这是我使用CarrierWave的模型:

class UploadedPrescription < ActiveRecord::Base
  mount_uploader :file, FileUploader  
  belongs_to :order

  validates_presence_of :file
end

你有没有试着传递一个文件。打开(路径到文件)?是的,谢谢
u = UploadedPrescription.new(file: ??what do i put here??)