2
it "should match login for existing account" do
{ :get => 'http://www.' + @business.subdomain + '.lvh.me:3000/login' }.should route_to({:controller => "go", :action => "index"})
end
match '/login' => 'admin/calendars#index' # this one should actually work, but fails:
The recognized options <{"controller"=>"errors", "action"=>"handle404", "a"=>"login"}> did not match <{"controller"=>"go", "action"=>"index"}>, difference: <{"controller"=>"go", "action"=>"index", "a"=>"login"}>.
這裏的特定的控制器#路線確實存在一個子目錄(或嵌套的路線),但目錄/嵌套路線(「管理/')似乎會導致失敗。考慮到那裏的指定路線('calendars#index')不存在,即使路線不存在,它也會以下一路線的方式失敗。結果路線的存在並不重要 - 因爲這只是爲了測試映射的工作原理。任何想法如何解決這個問題?RSpec的似乎打破時的路線「匹配」語句上市
match '/login' => 'calendars#index' #this one fails as expected:
The recognized options <{"controller"=>"calendars", "action"=>"index"}> did not match <{"controller"=>"go", "action"=>"index"}>, difference: <{"controller"=>"go"}>