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: ./test/unit/../test_helper.rb:18: undefined method ''use_transactional_fixtures='' 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. Any help is very much appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060416/20e45acf/attachment.html
How about you weekday folk? Anyone have an idea about this problem? On 4/15/06, Eden Brandeis <ebrandeis@gmail.com> wrote:> > 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: > > ./test/unit/../test_helper.rb:18: undefined method > ''use_transactional_fixtures='' > > 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. > > Any help is very much appreciated. >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060417/3098d7c5/attachment-0001.html
Eden Brandeis wrote:>On 4/15/06, *Eden Brandeis* <ebrandeis@gmail.com> 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=. There is no such method. Does line 18 of ./test/test_helper.rb say use_transactional_fixtures=true You probably want to replace this with self.use_transactional_fixtures = true -- Ray
Ray, Thank you for the suggestion. Line 18 is currently: self.use_transactional_fixtures = true Any other ideas? Eden On 4/17/06, Ray Baxter <ray@warmroom.com> wrote:> > Eden Brandeis wrote: > > >On 4/15/06, *Eden Brandeis* <ebrandeis@gmail.com > > > 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=. > > There is no such method. > > Does line 18 of ./test/test_helper.rb say > > use_transactional_fixtures=true > > You probably want to replace this with > > self.use_transactional_fixtures = true > > > -- > > Ray > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060417/13ebb262/attachment-0001.html
Eden Brandeis wrote:> Ray, > > Thank you for the suggestion. > > Line 18 is currently: > > self.use_transactional_fixtures = trueAfter posting I realized that that was probably true and that your problem is that you aren''t requiring the right modules. Do you have require ''test_help'' ? I can get the same error as you if I comment out that line in my test_helper.rb. -- Ray
Hi Ray, Here is my whole test_helper.rb with comments removed: ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require ''test_help'' 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 Rails::Initializer.run(:set_load_path) Thank you again for your help, Eden On 4/17/06, Ray Baxter <ray@warmroom.com> wrote:> > Eden Brandeis wrote: > > Ray, > > > > Thank you for the suggestion. > > > > Line 18 is currently: > > > > self.use_transactional_fixtures = true > > > After posting I realized that that was probably true and that your > problem is that you aren''t requiring the right modules. > > Do you have > > require ''test_help'' > > ? I can get the same error as you if I comment out that line in my > test_helper.rb. > > -- > > Ray > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060417/5dea42b3/attachment.html
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. - Derek On 4/17/06, Eden Brandeis <ebrandeis@gmail.com> wrote:> Hi Ray, > > Here is my whole test_helper.rb with comments removed: > > ENV["RAILS_ENV"] = "test" > require File.expand_path(File.dirname(__FILE__) + "/../config/environment") > require ''test_help'' > > 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 > > Rails::Initializer.run(:set_load_path) > > Thank you again for your help, > > Eden > > > On 4/17/06, Ray Baxter < ray@warmroom.com> wrote: > > Eden Brandeis wrote: > > > Ray, > > > > > > Thank you for the suggestion. > > > > > > Line 18 is currently: > > > > > > self.use_transactional_fixtures = true > > > > > > After posting I realized that that was probably true and that your > > problem is that you aren''t requiring the right modules. > > > > Do you have > > > > require ''test_help'' > > > > ? I can get the same error as you if I comment out that line in my > > test_helper.rb. > > > > -- > > > > Ray > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Derek Haynes HighGroove Studios - http://www.highgroove.com San Mateo, CA | Atlanta, GA Keeping it Simple. 650.276.0908
Derek Haynes wrote:> 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. A. -- Posted via http://www.ruby-forum.com/.