On 12/19/06, Zouplaz <user / domain.invalid> wrote:
> le 18/12/2006 06:50, Eric Hodel nous a dit:
>
> >
> > Can you include a failure?
> >
>
> Yes, the one below - Is there something wrong ? I really don't see the
> cause. Just for info, the test_helper.rb is unmodified.
>
> 22) Failure:
> test_destroy(VehiculesControllerTest)
> [./test/functional/vehicules_controller_test.rb:39]:
> Expected response to be a <:success>, but was <302>
>
> The overall autotest gives : 81 tests, 309 assertions, 13 failures, 12
> errors
>
> ************************** vehicules_controller_test.rb
>
> def test_destroy
>      s = @johnfoo.vehicules.size
>      post :destroy, :id => @johnfoo.vehicules[0].id
>      assert_response :success
>      @johnfoo.reload
>      assert_equal s-1, @johnfoo.vehicules.size
> end
>
> ************************** vehicules_controller.rb
>
> def destroy
>      @client = Vehicule.find(params[:id]).client
>      Vehicule.destroy(params[:id])
>      render :partial => 'liste'
> end
>
> ************************** rake:functionals
>
> (in /usr/local/www/ror_mica)
> /usr/bin/ruby -Ilib:test
> "/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb"
> "test/functional/clients_controller_test.rb"
> "test/functional/telephones_controller_test.rb"
> "test/functional/vehicules_controller_test.rb"
> "test/functional/alerts_controller_test.rb"
> "test/functional/forfaits_controller_test.rb"
> "test/functional/mouvements_controller_test.rb"
> "test/functional/statistiques_controller_test.rb"
> "test/functional/factures_controller_test.rb"
> Loaded suite
> /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader
> Started
> ...........................................
> .
> Finished in 8.999147 seconds.
>
> 44 tests, 185 assertions, 0 failures, 0 errors

A few things to try before you assume its autotest:

1) run the single failing test method in question by itself
2) run the functional test case in question by itself
3) run the functional test suite by itself

These steps will often turn up issues where fixtures aren't specified
where they should be, or where test order is playing a part (where it
shouldn't be).

- Rob

-- 
http://www.robsanheim.com
http://www.seekingalpha.com
http://www.ajaxian.com