How do you solve FixtureClassNotFound: No class attached to find
问题 When running my tests I get this error: FixtureClassNotFound: No class attached to find What causes this error and how to fix it? 回答1: Most likely this happens because a custom table name is used for a Model (using the set_table_name) or the model is in a module. To solve, you need to add a set_fixture_class line in the test_helper.rb before the fixtures :all line: class ActiveSupport::TestCase self.use_transactional_fixtures = true . . . set_fixture_class my_table_name: MyModule::MyClass