HI all
If I have two functional tests that test the same controller, I get
fixture errors. Is this right?
here is one
require File.dirname(FILE) + ‘/…/test_helper’
require ‘summary_controller’
Re-raise errors caught by the controller.
class SummaryController; def rescue_action(e) raise e end; end
class SummaryControllerTest < Test::Unit::TestCase
all_fixtures
and here is the other
require File.dirname(FILE) + ‘/…/test_helper’
require ‘summary_controller’
Re-raise errors caught by the controller.
class SummaryController; def rescue_action(e) raise e end; end
class SummaryControllerTest < Test::Unit::TestCase
fixtures :users, :decisions, :roles
Here is the error it produces…
- Error:
test_choose_chart(SummaryControllerTest):
NoMethodError: You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/fixture
s.rb:498:inusers' ./test/functional/summary_controller_test.rb:42:in
test_choose_chart’
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19
:in__send__' c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19 :in
run’
on this line:
admin = users(:admin)
Have any of you run into a similar problem before?