Rails testing - Fixtures for has_many associations
问题 I am new to unit testing and have a simple use case. There are 2 models: City , Resident . A City has_many Residents. I created 2 fixture yml files: cities.yml, residents.yml. residents.yml resident1: name: resident1 resident2: name: resident2 resident3: name: resident3 cities.yml city1: name: city1 residents: resident1, resident2, resident3 When I run a trivial test that should always pass, I get an error : Minitest::UnexpectedError: ActiveRecord::StatementInvalid: Mysql2::Error: Unknown