Pages

Sponsorship

40% off your First Order with GoDaddy.com!

Jan 11, 2010

Rails: Minor annoyances in Rails


Here's one "surprise" and one annoyance I've found while working with Rails.

Using PostGreSQL as the DB works beautifully in the development environment, but often fails in the test environment; however it only fails on rake test and only on the unit test portion of the full suite. Integration and functional tests run fine. One fix, was to change the database.rake file, in the db:prepare task to always use db:test_clone_structure instead of db:test:clone.

The annoyance is that controller modules appear to be bolted on without much consider for how they interact with the rest of the system — they greatly constrain your routes; most test tools seem unaware of them (rcov's rails task doesn’t know to look for subdirectories in the functional tests, etc) Some of these are easy to fix, some aren't, but it definitely feels like controller modules aren’t considered truly part of Rails.

No comments:

Post a Comment