Skip to content

hmsf/warden-rspec-rails

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Rails controller spec helpers for warden

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%