我創建了一個定製的設計註冊控制器,我想用rspec來測試它。RSpec-2和設計
我一個非常簡單的測試試了一下:
it "creates a new parent" do
Parent.should receive(:new)
post :create
end
,但我得到這個異常:
Failures:
1) Parent::RegistrationsController POST create creates a new parent
Failure/Error: post :create, { :commit => "Daftar",
uncaught throw `warden'
# /home/starqle/.rvm/gems/ree-1.8.7-2010.02/gems/devise-1.1.3/lib/devise/hooks/timeoutable.rb:16:in `throw'
# /home/starqle/.rvm/gems/ree-1.8.7-2010.02/gems/devise-1.1.3/lib/devise/hooks/timeoutable.rb:16
我已經把我的測試中這行:
describe Parent::RegistrationsController do
include Devise::TestHelpers
end
我也已經把這一行:
request.env["devise_mapping"] = Devise.mappings[:parent]
有人有想法解決這個問題嗎?
哦,還有一件事..只有當我在我的自定義控制器中使用sign_in方法時纔會發生...... – giosakti 2010-10-07 02:54:08