vendredi 20 janvier 2017

Tests failing Paperclip::AdapterRegistry::NoHandlerError: No handler found

I have been searching around but I cannot find a solution to this problem. I cannot get my tests to pass when testing create action that has an attached image. Whenever I run the test I get this error

Error:
CampaignsControllerTest#test_should_create_campaign:
Paperclip::AdapterRegistry::NoHandlerError: No handler found for "/campaign_backgrounds/original/missing.png"
app/controllers/campaigns_controller.rb:54:in `create'

I added the image missing.png to the "/campaign_backgrounds/original/missing.png" but the error persists.

Here is my test

test "should create campaign" do
assert_difference('Campaign.count') do
  post campaigns_url, params: { campaign: { title: @campaign.title, campaign_background: @campaign.campaign_background, campaign_logo: @campaign.campaign_logo  } }
end

assert_redirected_to campaign_url(Campaign.last)
end

Is there something i'm missing here?

Aucun commentaire:

Enregistrer un commentaire