1
我有一個應用程序,其定製版本爲Devise::RegistrationsController
。當我嘗試運行它,我得到以下錯誤:編寫自定義設計動作的規格
Failure/Error: post :create
AbstractController::ActionNotFound:
Could not find devise mapping for path "/users".
Maybe you forgot to wrap your route inside the scope block? For example:
devise_scope :user do
match "/some/route" => "some_devise_controller"
end
我不知道爲什麼我得到這個錯誤,因爲一切功能,從用戶的角度來看就好了。下面是我在routes/config.rb
:
devise_for :users, :path_names => {:sign_in => 'login', :sign_out => 'logout', :sign_up => 'signup'}
任何想法?在爲Devise控制器編寫規格時,我有什麼特別的要求嗎?
你接着說:RSpec.configure做模型|配置| config.include Devise :: TestHelpers,:type =>:controller end'? –