Forum: RSpec Error: undefined method `use_transactional_fixtures

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
910dbaf2f5dabdec5c05dedd5c47193e?d=identicon&s=25 waseem ahmad (Guest)
on 2009-01-07 08:07
(Received via mailing list)
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-n...
Maxim's comment

What could be possibly wrong?
Ff937b6907db49432c980f2b6a5c7e71?d=identicon&s=25 Mischa Fierer (mischa)
on 2009-01-07 08:55
(Received via mailing list)
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-01-07 10:30
(Received via mailing list)
On Wed, Jan 7, 2009 at 12:29 AM, waseem ahmad <cougar2149@gmail.com>
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?
910dbaf2f5dabdec5c05dedd5c47193e?d=identicon&s=25 waseem ahmad (Guest)
on 2009-01-07 10:57
(Received via mailing list)
On Wed, Jan 7, 2009 at 2:55 PM, David Chelimsky
<dchelimsky@gmail.com>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
48641c4be1fbe167929fb16c9fd94990?d=identicon&s=25 Mark Wilden (Guest)
on 2009-01-07 19:27
(Received via mailing list)
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
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-01-07 19:28
(Received via mailing list)
On Wed, Jan 7, 2009 at 12:20 PM, Mark Wilden <mark@mwilden.com> 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?
48641c4be1fbe167929fb16c9fd94990?d=identicon&s=25 Mark Wilden (Guest)
on 2009-01-07 20:14
(Received via mailing list)
On Wed, Jan 7, 2009 at 10:26 AM, David Chelimsky
<dchelimsky@gmail.com>wrote:

> On Wed, Jan 7, 2009 at 12:20 PM, Mark Wilden <mark@mwilden.com> 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. :)

///ark
910dbaf2f5dabdec5c05dedd5c47193e?d=identicon&s=25 waseem ahmad (Guest)
on 2009-01-08 06:28
(Received via mailing list)
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?
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-01-08 14:46
(Received via mailing list)
On Wed, Jan 7, 2009 at 11:26 PM, waseem ahmad <cougar2149@gmail.com>
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
Dfc7587fd73f2efa19d6f1f9611b70ba?d=identicon&s=25 Jason Fb (jasonfb)
on 2010-02-26 20:44
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/ra...


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-n...
> Maxim's comment
>
> What could be possibly wrong?
This topic is locked and can not be replied to.