Actions when testing resources with namespaces.


I have an admin tool in the namespace admin in this way:

map.namespace :admin do |admin|
    admin.resources :products

and I've also have a

map.resources :products

except that the last one is nice (or tries to be) and the first one allows to
edit, update, create and destroy.

For testing admin/products_controller I have the following code:

class Admin::ProductsControllerTest < ActionController::TestCase
  def test_should_create_product
    assert_difference('Product.count') do
      post :create, :product => {}
    assert_redirected_to admin_product_path(assigns(:product))

When I run the test I get

  1) Error:
NoMethodError: undefined method `product_url' for

Well, of course, product_url doesn't and should not exists. But post should be
trying to run admin_product_url. How can I make that work?

Thank you.