This is a bare-minimum testem configuration file that will allow you to use testem with a rails project. You save it in the root directory of the project (at the same level as the Gemfile), and then you can navigate to the project and run testem.
How it works:
What this configuration does is precompile the assets before the tests are run using the asset pipeline. After the tests are run, the precompiled assets are removed. I use RSPEC, so I put my tests in spec/scripts/ to follow the existing directory structure.
Keep in mind that sometimes browsers may fail their tests because the files are removed. The way to resolve this is to simply re-run the tests. And the tests may be slow to run because of the precompilation process, but it's not terrible. Plus, it makes sure you are testing your code as it will appear in production (which is what you want!).