Error: undefined method `use_transactional_fixtures

Hi,

I get this error when I do

$spec /spec/any_spec

/home/waseem/app/spec/spec_helper.rb:14: undefined method
use_transactional_fixtures=' for #<Spec::Example::Configuration:0xb6d9f218> (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner.rb:184:in configure’
from /home/waseem/app/spec/spec_helper.rb:10
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require’
from ./spec/controllers/user_sessions_controller_spec.rb:1
from
/usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb:14:in
load' from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb:14:in load_files’
from
/usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb:13:in
each' from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb:13:in load_files’
from
/usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/options.rb:98:in
run_examples' from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/command_line.rb:10:in run’
from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/bin/spec:4
from /usr/bin/spec:19:in `load’
from /usr/bin/spec:19

I googled it and got
http://ryandaigle.com/articles/2008/11/19/what-s-new-in-edge-rails-application-rb-duality-is-no-moresee
Maxim’s comment

What could be possibly wrong?

this may help:

http://themomorohoax.com/2008/12/17/rails-2-3-tests

On Wed, Jan 7, 2009 at 12:29 AM, waseem ahmad [email protected]
wrote:

`configure’
/usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb:14:in
from
What could be possibly wrong?
Seems like it’s not loading up rspec-rails’ Configuration object. In
order for that to happen implicitly, the specs need to be in any of
spec/models, spec/controllers, spec/views, spec/helpers. Is your file
in one of those?

On Wed, Jan 7, 2009 at 2:55 PM, David C.
[email protected]wrote:

Seems like it’s not loading up rspec-rails’ Configuration object. In
order for that to happen implicitly, the specs need to be in any of
spec/models, spec/controllers, spec/views, spec/helpers. Is your file
in one of those?

Yeah the file is spec/controllers/user_sessions_controller.rb

@Mischa: The pointer you gave talks about rails edge. Right now I am on
rails 2.1

FWIW, I was getting this error yesterday. I completely uninstalled rspec
and
rspec-rails (including David’s code from GitHub) and reinstalled, and it
“went away.”

///ark

On Wed, Jan 7, 2009 at 12:20 PM, Mark W. [email protected] wrote:

FWIW, I was getting this error yesterday. I completely uninstalled rspec and
rspec-rails (including David’s code from GitHub) and reinstalled, and it
“went away.”

Which version did you install after removing everything?

I have both the rspec 1.1.11 and rspec-rails 1.1.11 as gems. I had them
plugged in my application too. When I removed them from my application
the
problem was solved. The version of both the gems and plugins are same.

Why did this happen?

On Wed, Jan 7, 2009 at 11:26 PM, waseem ahmad [email protected]
wrote:

I have both the rspec 1.1.11 and rspec-rails 1.1.11 as gems. I had them
plugged in my application too. When I removed them from my application the
problem was solved. The version of both the gems and plugins are same.

Why did this happen?

I haven’t seen the problem of use_transactional_fixtures before, but
there were some problems with installing rspec/rspec-rails as gems w/
1.1.11.

This will be fixed in the 1.1.12 release coming shortly.

Cheers,
David

On Wed, Jan 7, 2009 at 10:26 AM, David C.
[email protected]wrote:

On Wed, Jan 7, 2009 at 12:20 PM, Mark W. [email protected] wrote:

FWIW, I was getting this error yesterday. I completely uninstalled rspec
and
rspec-rails (including David’s code from GitHub) and reinstalled, and it
“went away.”

Which version did you install after removing everything?

1.1.16, of course.

Kidding - 1.1.11. :slight_smile:

///ark

This happens when you generate tests pre-Rails 2.3 then upgrade to Rails
2.3.

go to test/test_helper.rb and change:
class Test::Unit::testCase

to:
class ActiveSupport::TestCase

http://www.datatravels.com/technotes/2009/04/21/rails-error-undefined-method-use_transactional_fix/

waseem ahmad wrote:

Hi,

I get this error when I do

$spec /spec/any_spec

/home/waseem/app/spec/spec_helper.rb:14: undefined method
use_transactional_fixtures=' for #<Spec::Example::Configuration:0xb6d9f218> (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner.rb:184:in configure’
from /home/waseem/app/spec/spec_helper.rb:10
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in require’
from ./spec/controllers/user_sessions_controller_spec.rb:1
from
/usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb:14:in
load' from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb:14:in load_files’
from
/usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb:13:in
each' from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/example_group_runner.rb:13:in load_files’
from
/usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/options.rb:98:in
run_examples' from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/lib/spec/runner/command_line.rb:10:in run’
from /usr/lib/ruby/gems/1.8/gems/rspec-1.1.11/bin/spec:4
from /usr/bin/spec:19:in `load’
from /usr/bin/spec:19

I googled it and got
http://ryandaigle.com/articles/2008/11/19/what-s-new-in-edge-rails-application-rb-duality-is-no-moresee
Maxim’s comment

What could be possibly wrong?