From: Rob Sanheim Date: 2006-10-10T17:46:45+09:00 Subject: Re: ZenTest/autotest - Problem with controller modules? On 10/9/06, Joe Ruby MUDCRAP-CE wrote: > Using rake, my tests all passed. And using autotest they all passed, > until I implemented this test: > > def test_vote > count = Item.find(1).vote_count > > get :vote, :id=>1, :vote=>5 > > @item = Item.find(1) > > assert_equal @item.vote_count, count+1 > assert_equal @item.vote_average, 5 > assert_equal @item.vote_total, 1 > assert_redirected_to item_url(:action=>:show, :id=>1) > end > > Now, autotest displays this: > > multiple files matched class ItemsControllerTest > ["test/functional/members/items_controller_test.rb", > "test/functional/items_controller_test.rb", > "test/functional/admin/items_controller_test.rb"]. > /opt/local/bin/ruby -I.:lib:test -rtest/unit -e > "%w[test/functional/items_controller_test.rb].each { |f| load f }" | > unit_diff -u > Loaded suite -e > Started > ...F > Finished in 1.239178 seconds. > > 1) Failure: > test_vote(ItemsControllerTest) > [./test/functional/items_controller_test.rb:48]: > --- /tmp/diff10537.0 2006-10-09 18:25:13.000000000 -0600 > +++ /tmp/diff10537.1 2006-10-09 18:25:13.000000000 -0600 > @@ -1 +1 @@ > - > +<5> > > 4 tests, 6 assertions, 1 failures, 0 errors > > Tests under rake still pass. If I comment out the assert_equal lines, > autotest doesn't display any errors. Any idea what the problem is? > Have you tried running that test in isolation? Via rake test:functionals? Many times that turns up weird test failures like that for me... - Rob -- http://www.robsanheim.com http://www.seekingalpha.com http://www.ajaxian.com