I have a Rails app (Rails – 2.3.8, Linux) which uses a MySQL database, but the database is generated separately (not through the Rails migration), so I would like to know
How can I implement testing on this application (please note currently there are no test suit at all)?
I would prefer not to have a database at all and test the functionality (including ActiveRecord models through the unit test) (because it will make the test suit independent as I see).
Currently I found this gem (temping – https://github.com/jpignata/temping) via a Stack Overflow link itself.
Please let me know if I’m going in a wrong direction.
This is a great resource on one method of TDD using RSpec which is more powerful than unit testing imo.
http://railscasts.com/episodes/275-how-i-test
If you are avoiding using MySQL you could simply specify Sqlite3 in your Database.yaml file:
Be sure to include Gem:
If you have having trouble with this install, checkout this question:
Why can't I install the SQLite gem?