Rails testing when using SQL Server, Part 2

I’ve learned (the hard way) a few more things about facilitating Rails automated testing when you are using Microsoft SQL Server.

Continuing the numbering from my prior post on this topic:

(3) In order for the built-in rake testing tasks (such as rake test:functionals) to work, you will need to uncomment the following line in your config/environment.rb file:

config.active_record.schema_format = :sql

If you don’t do this, Rails will try to autogenerate the schema.rb file as for MySQL and it will be a mess.

(4) Also in order for the built-in rake testing tasks to work, you need to have the rather obscure Microsoft utility called “scptxfr” on your DOS path.  (scptxfr creates a SQL script from your database.) In my installation it was located in C:\Program Files\Microsoft SQL Server\80\Tools\Upgrade.  To change the path, right-click on the My Computer icon, and choose Properties -> Advanced tab -> Environment Variables.

Earlier: Part 1

blog comments powered by Disqus