[Rails] [Bug] use_transactional_fixtures = false suppress the 'fixtures' method

Hi folks,

I’m having a problem with fixtures. When I configure RSpec to don’t use
transactional fixtures, the fixtures method goes away.
Supposing there’s a State model and a fixture file with two records,
this
works flawlessly:

RSpec.configure do |config|
#…
config.use_transactional_fixtures = true
end
describe State do
fixtures :all

it ‘should bring the fixtures from database’ do
State.all.should have(2).states
end
end

But when I set config.use_transactional_fixtures = false, I get this
error:

./spec/models/state_spec.rb:4:in block in <main>': undefined methodfixtures’ for #Class:0x000001009296a8 (NoMethodError)
from
/Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:129:in
module_eval' from /Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:129:insubclass’
from
/Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:116:in
describe' from /Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/extensions/object.rb:7:indescribe’
from ./spec/models/state_spec.rb:3:in `’

I’m using Rails 3, RSpec 2.0.0.beta.20 and the same version of
rspec-rails
(I also used the code directly from Gihub but it didn’t work too).
I suppose this is a bug, but I just wanted to confirm with you guys
before
opening the issue ticket.

And thanks for this great thing that RSpec is

Hi folks,

I’m having a problem with fixtures. When I configure RSpec to don’t use
transactional fixtures, the fixtures method goes away.
Supposing there’s a State model and a fixture file with two records,
this
works flawlessly:

RSpec.configure do |config|
#…
config.use_transactional_fixtures = true
end
describe State do
fixtures :all

it ‘should bring the fixtures from database’ do
State.all.should have(2).states
end
end

But when I set config.use_transactional_fixtures = false, I get this
error:

./spec/models/state_spec.rb:4:in block in <main>': undefined methodfixtures’ for #Class:0x000001009296a8 (NoMethodError)
from
/Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:129:in
module_eval' from /Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:129:insubclass’
from
/Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:116:in
describe' from /Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/extensions/object.rb:7:indescribe’
from ./spec/models/state_spec.rb:3:in `’

I’m using Rails 3, RSpec 2.0.0.beta.20 and the same version of
rspec-rails
(I also used the code directly from Gihub but it didn’t work too).
I suppose this is a bug, but I just wanted to confirm with you guys
before
opening the issue ticket.

And thanks for this great thing that RSpec is

On Sep 3, 2010, at 7:41 PM, Lailson B. wrote:

Hi folks,

I’m having a problem with fixtures. When I configure RSpec to don’t use transactional fixtures, the fixtures method goes away.
Supposing there’s a State model and a fixture file with two records, this works flawlessly:

RSpec.configure do |config|
#…
config.use_transactional_fixtures = true
end
describe State do
fixtures :all

it ‘should bring the fixtures from database’ do
State.all.should have(2).states
end
end

But when I set config.use_transactional_fixtures = false, I get this error:

./spec/models/state_spec.rb:4:in block in <main>': undefined method fixtures’ for #Class:0x000001009296a8 (NoMethodError)
from /Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:129:in module_eval' from /Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:129:in subclass’
from /Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/example_group.rb:116:in describe' from /Users/lailsonbm/.rvm/gems/ruby-1.9.2-p0@rails3/gems/rspec-core-2.0.0.beta.20/lib/rspec/core/extensions/object.rb:7:in describe’
from ./spec/models/state_spec.rb:3:in `’

I’m using Rails 3, RSpec 2.0.0.beta.20 and the same version of rspec-rails (I also used the code directly from Gihub but it didn’t work too).
I suppose this is a bug, but I just wanted to confirm with you guys before opening the issue ticket.

Yep. Bug. Please report to Issues · rspec/rspec-rails · GitHub.

And thanks for this great thing that RSpec is

Thanks for that.

Cheers,
David

Ok David. Here it is:

Thanks for your fast response

LAILSON BANDEIRA
http://lailsonbandeira.com/