我最近将基于 RefineryCMS 的应用程序从 Rails 3.2.2 升级到了 3.2.6。
在升级之前,炼油厂页面控制器的以下规范运行良好:
describe Refinery::PagesController do
render_views
context "Should check the ability to see a page" do
before(:each) do
@live_page = FactoryGirl.create(:live_refinery_page)
@restricted_page = FactoryGirl.create(:restricted_refinery_page)
@draft_page = FactoryGirl.create(:draft_refinery_page)
@error_page = FactoryGirl.create(:error_refinery_page)
end
context "for a not logged in user" do
it "should see live pages" do
get :show, :path => @live_page.slug, :format => "html"
response.should be_success
response.should render_template "refinery/pages/show"
end
...
应该匹配的路由定义如下:
marketable_page GET /*path(.:format) refinery/pages#show
现在,问题在于我在所有测试中都遇到了这样的错误:
1) Refinery::PagesController Should check the ability to see a page for a not logged in user should see live pages
Failure/Error: get :show, :path => @live_page.slug, :format => "html"
ActionController::RoutingError:
No route matches {:path=>"live-page-1", :format=>"html", :controller=>"refinery/pages", :action=>"show"}
# ./config/initializers/refinery/monkey_patches.rb:13:in `around_generate'
# ./spec/controllers/refinery/pages_controller_spec.rb:17:in `block (4 levels) in <top (required)>
我怎样才能使路线在规格中被识别?也许它与路线通配有关?
有什么提示吗?