Skip to content
RaulKite edited this page Feb 6, 2013 · 2 revisions

Test::Unit

In your test_helper.rb

class ActionController::TestCase
  include Devise::TestHelpers
end

class ActionDispatch::IntegrationTest
  include Warden::Test::Helpers
  Warden.test_mode!
end

Be sure to call Warden.test_reset! at the end of your tests!

Cucumber

In features/support/env.rb

#Warden Helpers
include Warden::Test::Helpers
Warden.test_mode!

After do
  Warden.test_reset!
end

In my steps

 @pepito = FactoryGirl.create(:user)
 login_as(@pepito, :scope => "user")
Clone this wiki locally