No commit activity in last 3 years
No release in over 3 years
Rails controller spec helpers for warden.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

What

Rails controller spec helpers for Warden. If you're using Warden without Devise in rails, due to how ActionController sets up the test environment, custom test setup code is necessary.

Usage

# Gemfile
group :test do
  gem 'warden-rspec-rails'
end

# spec_helper.rb
RSpec.configure do |c|
  c.include Warden::Test::ControllerHelpers, type: :controller
end

This will define helper methods in controller tests that you can use to manage authentication, such as:

  • warden: Access the Warden::Proxy.
  • login_as: Same as the Warden::Test::Helpers login_as method.
  • logout: Same as the Warden::Test::Helpers logout method.
  • unlogin: Removes the user(s) from the logged-in list, but leaves the session value so the user can be fetched on access.

Thanks