lundi 2 décembre 2019

While testing image upload "Errno::EROFS: Read-only file system @ dir_s_mkdir -/" (PaperClip)

I'm using PaperClip for image uploading but now I'm trying to do some test for it.

  test "should update product cover" do
    patch admin_product_path(@product),
      params: { product: {
        cover: fixture_file_upload("file.png")
        }
      }
      assert_redirected_to admin_product_path(@product)
  end

I have my 'file.png' in fixture folder. But I'm getting this error:

ERROR["test_should_update_product_cover", #<Minitest::Reporters::Suite:0x00007fa19b4b1150 @name="Admin::ProductsControllerTest">, 6.406153999999333]
 test_should_update_product_cover#ProductsControllerTest (6.41s)
Errno::EROFS:         Errno::EROFS: Read-only file system @ dir_s_mkdir - /products
            app/controllers/products_controller.rb:37:in `update'
            test/controllers/products_controller_test.rb:109:in `block in <class:ProductsControllerTest>'

I'm not sure if I have to give any permission.

Thanks for your attention!

My rails version 5.2.3 Ruby version 2.6.3p62

Aucun commentaire:

Enregistrer un commentaire