How to write test cases for MSSQL backed Rails app

19 views
Skip to first unread message

Uday BK

unread,
Sep 10, 2015, 11:28:03 AM9/10/15
to rubyonra...@googlegroups.com
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

--
Posted via http://www.ruby-forum.com/.

KlausG

unread,
Sep 10, 2015, 6:30:56 PM9/10/15
to Ruby on Rails: Talk
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
Reply all
Reply to author
Forward
0 new messages