How to write test cases for MSSQL backed Rails app

Hi,

I have used cucumber/RSpec before while using MySQL & SQlite but my new
project application is so gigantic & doesn't have any unit-tests with in
the app. So I want to write unit/functional and integration tests to it
but I dont have a schema for the data since its backed by MSSQL db.

1. How do I get a schema dump or test data from what I have?
2. I want to create a test sqlite3 db that mimicks production db so that
I can run my tests against it.

Any information would be of great help.

Thanks,
Uday

Hi,

you may use “rake db:schema:dump” to get the current schema out of your SQL Server DB.

If there are no migrations Rails will use the schema.rb file to setup your test database.

BUT: you can not use the Sql Server schema dump for a sqlite db, as it may contain

special Sql Server datatypes (varchar, char, real, money, …)

Yoe have to search/replace this datatypes to simple datatypes (string, text, float )

hf Klaus