I am trying to use paperclip with factory_girl gem but getting a "no handler found error" message.
test_should_update_category(CategoriesControllerTest): Paperclip::AdapterRegistry::NoHandlerError: No handler found for "/system/categories/images/000/000/001/original/tel1.JPG?1354197869"
Factory girl file:
FactoryGirl.define do
factory :category do
name "MyString"
description "MyText"
image { File.new(File.join(Rails.root, 'test','tel1.JPG')) }
end
end
category migration ::---------------
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
model:
class Category < ActiveRecord::Base
attr_accessible :description, :image, :name
has_attached_file :image, :styles => { :thumb => "100x100>" }
end
category controller test file:
require 'test_helper'
class CategoriesControllerTest < ActionController::TestCase
setup do
@category = FactoryGirl.create(:category)
end