If have namespaced model classes, Party::Base and Party::Address, with their corresponding Unit test in the test/party directory the unit for the first starts failing once the second is added with a "FixtureClassNotFound: No class attached to find" error even if set_fixture_class is explicitly denoted.
When I remove the second unit test from the directory, everything runs fine once again.
My model classes are as follows:
class Party::Base < ActiveRecord::Base
set_table_name :parties
has_many :addresses,
:foreign_key => 'party_id'
end
class Party::Address < ActiveRecord::Base
belongs_to :party,
:class_name => "Party::Base",
:foreign_key => 'party_id'
end
A simple unit test for Party::Base works fine if no other test is present.
require 'test_helper'
class Party::BaseTest < ActiveSupport::TestCase
fixtures :parties
set_fixture_class :parties => Party::Base
-
Replace this with your real tests.
def test_james_in_fixture
assert(parties(:one).name == "James McLachlan")
end
end
once I add Party::AddressTest if gives me the error:
test_james_in_fixture(Party::PartyTest):
FixtureClassNotFound: No class attached to find.