Sto tentando di utilizzare paperclip con factory_girl gem ma ottenere un messaggio di errore "nessun handler trovato ". file di ragazzaUtilizzo di paperclip con factory girl, nessun errore di gestore immagini
test_should_update_category(CategoriesControllerTest): Paperclip::AdapterRegistry::NoHandlerError: No handler found for "/system/categories/images/000/000/001/original/tel1.JPG?1354197869"
fabbrica:
FactoryGirl.define do
factory :category do
name "MyString"
description "MyText"
image { File.new(File.join(Rails.root, 'test','tel1.JPG')) }
end
end
categoria migrazione :: ---------------
class CreateCategories < ActiveRecord::Migration
def up
create_table :categories do |t|
t.string :name
t.text :description
t.string :image
t.timestamps
end
add_attachment :categories, :image
end
modello:
class Category < ActiveRecord::Base
attr_accessible :description, :image, :name
has_attached_file :image, :styles => { :thumb => "100x100>" }
end
file di test del controller di categoria:
require 'test_helper'
class CategoriesControllerTest < ActionController::TestCase
setup do
@category = FactoryGirl.create(:category)
end