I am running Rails 1.1.2 with Ruby 1.82-15. My database is Postgresql.
I
haven’t had any problems generating models, migrations, using scaffolds,
and
generally building and using my application, but I haven’t been able to
get
testing to work. I initially just ignored the problem and kept
developing,
but would like to add proper testing from here on out.
Currently when I type rake in my application directory, it attempts to
load
my unit tests (all generated files with single default assertion), but
immediately fails with the error:
I read up on transactional_fixtures and testing in general and also
searched
this list and in Google, but haven’t been able to find any reference to
this
problem. It is probably something stupid simple, but I am at a dead end
for
now.
Has anyone else run into this? At this point I have deleted all my
controllers and views along with the functional test fixtures just to
attempt to narrow the problem down with just models and unit tests.
Currently when I type rake in my application directory, it attempts
to load my unit tests (all generated files with single default
assertion), but immediately fails with the error:
./test/unit/../test_helper.rb:18: undefined method
'use_transactional_fixtures='
You are invoking the method use_transactional_fixtures=.
class Test::Unit::TestCase
self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false
end
Also, just in case something went wrong during my upgrade to 1.1.2, here
is
boot.rb:
unless defined?(RAILS_ROOT)
root_path = File.join(File.dirname(FILE), ‘…’)
unless RUBY_PLATFORM =~ /mswin32/
require ‘pathname’
root_path = Pathname.new(root_path).cleanpath(true).to_s
end
RAILS_ROOT = root_path
end
if File.directory?("#{RAILS_ROOT}/vendor/rails")
require “#{RAILS_ROOT}/vendor/rails/railties/lib/initializer”
else
require ‘rubygems’
require ‘initializer’
end
Anyone come up with a reason for this? I’m getting the same error when
running an app on linux. It works fine on mac osx.
Could it be you’re not running against the gem versions you think you
are ? It looks almost like it was genberated with one version of rails
and is running against an older version (which doesn’t have the
transactional fixtures).
I’m not sure how to go about dumping out gem version numbers at runtime,
but it might be worth trying something like that in your test file.