On Apr 3, 4:45 am, elle <wazne...@gmail.com> wrote:

>
> ./test/functional/categories_controller_test.rb:8: undefined method
> `fixtures' for CategoriesControllerTest:Class (NoMethodError)
> from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/
> active_support/dependencies.rb:147:in
> `load_without_new_constant_marking'
> ....
> rake aborted!
> Command failed with status (1): [/usr/local/bin/ruby -I"/...]
>
> --------------------------------------------------------------------------- 
> -----
> The ./test/functional/categories_controller_test.rb has:
>
> require File.dirname(__FILE__) + '/../test_helper'
> require 'categories_controller'
>
> # Re-raise errors caught by the controller.
> class CategoriesController; def rescue_action(e) raise e end; end
>
> class CategoriesControllerTest < Test::Unit::TestCase
>   fixtures :categories
> ....

Looks like scafold_resource has created tests with the old boiler
plate - the above can be replaced by


require File.dirname(__FILE__) + '/../test_helper'
class CategoriesControllerTest < ActionController::TestCase
...
end

and you no longer need to have the setup method that creates @request,
@response, @controller.
(this assumes that you have fixtures :all in test_helper.rb which I
believe is the default)

Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to