rspec 出现以下错误:
1) LandingController landing#index returns http success
Failure/Error: get :index
ActionController::RoutingError:
No route matches {:controller=>"landing"}
# ./spec/controllers/landing_controller_spec.rb:7:in `block (3 levels) in <top (required)>'
这是测试
require 'spec_helper'
describe LandingController do
describe "landing#index" do
it "returns http success" do
get :index
response.should be_success
end
end
end
我将它安装为root :to => 'landing#index'
. 所有其他测试都通过了,只有这个失败了,有人可以帮我理解为什么吗?
为了完整起见,这是来自rake routes
root / landing#index
auth_google_oauth2_callback /auth/google_oauth2/callback(.:format) sessions#create
signout /signout(.:format) sessions#destroy
dashboard /dashboard(.:format) dashboard#index