I'm currently writing unit tests for my Ruby on Rails application, and one of my models is a normal Ruby class for parsing XML files. I now wish to write unit tests for this class using a correct and incorrect xml file. The only question is, where do I place these files inside the entire Ruby on Rails structure?
I can probably dump em anywhere I want, but I was wondering if there is some sort of convention on where to place them so that I can just call 'correct.xml' as path for the unit tests instead of specifying the enti开发者_如何学Cre path.
A good place to put your file is test\fixtures\assets
Since you writing a test cases for your model so better keep all test cases under the following directory.
Project\test\unit
精彩评论