Hi, I have a strange problem with testing classes which have a HABTM relation. It seems that while running my tests with rake the fixture for the association table is not loaded - as a result I get a failure on a test which simply checks the number of associated elements - it says it's 0 although there should be one. The weird thing is that when I run the tests with rcov there's no failure :| Also, when I do script/console "test" I can see that the association gets loaded and the same code that fails in the test works. Anybody seen something like this? -- Agnieszka Figiel
on 2006-02-23 13:30
on 2006-02-23 14:49
Look in your test logs to see what is happening when you are running your tests with rake. If you have constraints on your database tables these could be causing problems when the tests are loading. Tests load differently using rake compared to running directly from the command line. If this is the case see: http://wiki.rubyonrails.org/rails/pages/DisableFor...