rake test fails
- by Pavel K.
i have a model (simplified)
class Myfile < ActiveRecord::Base
validates_attachment_size :body, :less_than => AdminOptions.first.max_file_size.megabytes
end
max_file_size is defined in AdminOptions fixture, but when i try to run "rake test", i get:
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in `method_missing': undefined method `max_file_size' for nil:NilClass (NoMethodError)
from /myapp/app/models/myfile.rb:1
if i run
ruby test/unit/myfile_test.rb
i get same mistake.
if i run:
RAILS_ENV=test rake db:load:fixtures
ruby test/unit/myfile_test.rb
tests execute properly.
if i try to
RAILS_ENV=test rake db:load:fixtures
rake test
it fails with same mistake.
does anyone know how to fix that?