ruby on rails - Testing Paperclip file uploading with RSpec -


I do not really care about uploading files, but I have validates_attachment_presence etc. . In my model, RSPC is complaining.

So now I will try and make my model with these attributes in the device to turn it off:

  @attr = {: name = & gt; "Value for Name",: Title = & gt; "Price for Title" ,: Content => "Value for content" ,: pic_file_name = & gt; "Example.jpg" ,: pic_content_type = & gt; "Image / jpg" ,: pic_file_size = & gt; "8192" ,: pic_updated_at =>  

This does not work, though.

I found this: So I tried to do something like this:

  post. Should_receive (: save_attached_files) .and_return (true)  

How can I please RSPC, which does not work?

If the model is the_name_file: picture , then you will be in some file < Code> pic should be able to point out the attribute and all should be stacked.

@attr = {: pic = & gt; File.open (File Join (Rails.root, 'spec', 'fixtures', 'file.png'))}


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -