How to use ruby-on-rails fixtures for setting up (external) data that does not belong to the rails app DB?
问题 Per my requirements, I have created models for querying external database (different from the one that the rails app uses) for some of the data. I am trying to write tests around these models and want to separate the "sample test data" from the actual tests. I thought I could put the data in a yml file and load it into a hash, but it did work out :( Added sample test data to a fixture file name 'external_database.yml' Put the below code in setup, in the test file ext_data = YAML.load_file