thoughtbot/paperclip — Issue #725: Undefined method `attachment_definitions=' in Unit Tests
Author: bradly
Created: 2012-02-01 20:06:03+00:00
State: open

Hello,

I am getting undefined method `attachment_definitions=' when running my TestUnit tests. I also have some Rspec specs, but those run without issue. The app runs without issue as well.

I am running Rails 2.3.5, Paperclip 2.5.0, Ruby 1.8.7p174

Here is the backtrace:
```
/Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in `method_missing_without_paginate': undefined method `attachment_definitions=' for # (NoMethodError)
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/will_paginate-2.3.15/lib/will_paginate/finder.rb:170:in `method_missing'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/paperclip-2.5.0/lib/paperclip.rb:325:in `has_attached_file'
from /Users/bfeeley/code/lc2/sdtax/fbi/prototypes/CIA/app/models/physical/user.rb:10
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
from /Users/bfeeley/code/lc2/sdtax/fbi/prototypes/CIA/test/mocks/test/user.rb:2
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:265:in `require_or_load'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:224:in `depend_on'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:136:in `require_dependency'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activerecord-2.3.5/lib/active_record/fixtures.rb:853:in `try_to_load_dependency'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activerecord-2.3.5/lib/active_record/fixtures.rb:868:in `require_fixture_classes'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activerecord-2.3.5/lib/active_record/fixtures.rb:865:in `each'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activerecord-2.3.5/lib/active_record/fixtures.rb:865:in `require_fixture_classes'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/activerecord-2.3.5/lib/active_record/fixtures.rb:848:in `fixtures'
from /Users/bfeeley/code/lc2/sdtax/fbi/prototypes/CIA/test/unit/../test_helper.rb:31
from /Users/bfeeley/code/lc2/sdtax/fbi/prototypes/CIA/test/unit/ab_batch_test.rb:1:in `require'
from /Users/bfeeley/code/lc2/sdtax/fbi/prototypes/CIA/test/unit/ab_batch_test.rb:1
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `require'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9:in `each'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:9
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5:in `each'
from /Users/bfeeley/.rvm/gems/ruby-1.8.7-p174@lc/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:5
rake aborted!
Command failed with status (1): [/Users/bfeeley/.rvm/rubies/ruby-1.8.7-p174...]
```