我有这些路线
# routes.rb
namespace :admin do
resources :departments
end
并在控制器测试中使用以下代码。它失败了,因为post :create没有前往admin_departments_path。写这个的正确方法是什么?
# test/functional/admin/departments_controller_test.rb
# ActionController::RoutingError: No route matches (FAIL)
post :create, :department => @new_department.attributes