mardi 21 février 2017

Carrierwave testing - clean up or separate file uploads?

I'd like some feedback and/or help please.

I'm having this test

scenario 'can create a new post' do

    attach_file('Image', 'spec/files/hello-world.png')
    fill_in 'Caption', with: 'Hello World! This is the first post!'
    click_button 'Create Post'

    expect(page).to have_css("img[src*='hello-world.png']")
    expect(page).to have_content('Post was successfully created')
end

This test uploads the image to uploads/post/image/1/hello-world.png through Carrierwave, which is probably the same path on development environment etc, so I wonder if this is going to cause any issues on between files and posts.

My question is do I need to keep separate the file uploads on each Environment, or is it something that Rails can manage internally?

Aucun commentaire:

Enregistrer un commentaire