paperclip_fixture + FactoryGirl

60 views
Skip to first unread message

Claudio Poli

unread,
Feb 13, 2012, 5:39:33 AM2/13/12
to factory_girl
Using RSpec:

FactoryGirl.define do
factory :user do
avatar { paperclip_fixture("user", "avatar", "png") }

undefined method `paperclip_fixture' for #<User:0x007f819ea7a748>

Can anyone explain what's the correct syntax for recent versions of
FactoryGirl please?

# spec/support/paperclip.rb
require "paperclip/matchers"

RSpec.configure do |config|
config.include Paperclip::Shoulda::Matchers
end

# spec/spec_helper.rb
Dir[Rails.root.join("spec/support/*.rb")].each { |f| require f }
Reply all
Reply to author
Forward
0 new messages