Hello, I posted a couple of days ago regarding a problem I had with restful authentication test failing. So, I tried it again. I started a new application, installed restful authentication, ran the tests and they all passed. So, the problem is not with the plugin. I do have another problem though and appreciate your help. I use rails 2.3.2 with restful authentication and resource_controller plugins. I created categories, products and pages using scaffold_resource.... This creates tests for me. I haven''t changed anything in the tests just yet. However, when running ''rake'', all the unit tests pass but the functional tests do not. I get an error that says (among other things): ./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 .... -------------------------------------------------------------------------------- Please help, Thanks, Elle --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Apr 3, 4:45 am, elle <wazne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Changing class CategoriesControllerTest < Test::Unit::TestCase to class CategoriesControllerTest < ActionController::TestCase ran my tests. Now I have some failures to fix :) Thanks Fred. Elle On Apr 3, 6:54 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Apr 3, 4:45 am, elle <wazne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---