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/DisableForeignKeyChecksUnderMySql
On 2/23/06, Agnieszka Figiel <agnieszka.figiel@gmail.com>
wrote:>
> 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
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060223/6af43869/attachment.html