Rspec нет соответствий маршрута

Я получаю следующую ошибку с 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

person Community    schedule 17.06.2012    source источник


Ответы (2)


Если вы используете Spork, вам может потребоваться перезапустить сервер, если вы обновили маршруты.

person Community    schedule 17.06.2012

Вы пытались получить доступ к корневой странице с помощью get '/'? должно сработать.

person billythetalented    schedule 17.06.2012
comment
Да, я пытался. И это не удается с ActionController::RoutingError: No route matches {:controller=>"landing", :action=>"/"} ` - person ; 18.06.2012