2

I have carrierwave setup. Its working without any issues. Now, below are the deal_images fixtures:

d1_image1:
  image: app_images/img1.png
  usage_tag: thumbnail
  deal: first_deal
d1_image2:
  image: app_images/img2.png
  usage_tag: thumbnail
  deal: second_deal

Now, what it does is just enter string in image and image.url is not pointing anywhere. I want to use image in app_image/img1.png to be uploaded when i run rake db:fixtures:load into uploads directory.

Is this correct way of doing it?

geekdeepak
  • 1,165
  • 11
  • 18
  • I guess this answers (even if it's using factory girl) will help you You should really try using factory_girl instead of fixtures for your tests, by the way. (moved to comment as it's not a valid a answer) – pjam Jul 16 '14 at 19:16
  • @amenthes I agree with you that the answer is not really helpful (I was pretty new to SO back then), therefore I deleted the answer and moved it to a comment. That being said, I still think the information in the link is helpful in some ways as it shows how to upload files with carrierwave in a test environment. – pjam Jul 16 '14 at 19:20

0 Answers0