ruby on rails - RSpec-2 and Devise -


i create customized devise registration controller , want test rspec.

i've tried simple test :

it "creates new parent"   parent.should receive(:new)   post :create end 

but exception:

failures:   1) parent::registrationscontroller post create creates 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 

i put line within test:

describe parent::registrationscontroller   include devise::testhelpers end 

i put line:

request.env["devise_mapping"] = devise.mappings[:parent] 

anybody have ideas solve problem?

my previous answer little confusing. sorry.

updated answer: root cause user not "confirmed" before "sign in".

@user.confirm!  sign_in @user 

then fine.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -