Hi, I''m stuck in a maze :
routes.rb defines resources like this one
map.namespace(:admin) do |admin|
    admin.resources :sections, :path_prefix =>
''/:locale/admin''
end
Then, in functionnal test I have to (for example)
get :index, :locale => ''en''
I need to provide the :locale for every test I write and I find this too
much verbose for me. So I tried to write a base test controller that
would add the locale parameter to every request.
class BaseTestController < ActionController::TestCase
 def get method, options = {}
   get method, options.merge({:locale => ''en''})
 end
end
Then, I define my test controller case like this
class Admin::SectionsControllerTest < BaseTestController
 def test_index
  get :index
  assert_response :success
 end
end
Running the test I get error about get method beeing undefined in
BaseTestController. And don''t understand why. There must be some
introspect mechanism used by Rails but how can I do ?
Any idea ?
BTW : the default_url_options method is useless here as it only works
with named routes and ignored by resources paths generator.
-- 
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---