public
Description: Rails authentication with email & password.
Homepage: http://thoughtbot.com
Clone URL: git://github.com/thoughtbot/clearance.git
name age message
file .gitignore Tue Mar 03 05:42:40 -0800 2009 Cleaning up some whitespace issues [qrush]
file CHANGELOG.textile Loading commit data...
file LICENSE Tue Nov 04 08:33:14 -0800 2008 Add license [mike-burns]
file README.textile Thu Mar 05 09:46:53 -0800 2009 bumping the gemspec to 0.5.3. clearance now wor... [dancroak]
file Rakefile Thu Mar 05 09:46:53 -0800 2009 bumping the gemspec to 0.5.3. clearance now wor... [dancroak]
file clearance.gemspec
directory generators/ Thu Mar 05 08:47:50 -0800 2009 tending to whitespace [dancroak]
directory lib/ Mon Mar 23 07:14:56 -0700 2009 Removing duplicate check for redirection to new... [qrush]
directory rails/ Sat Sep 06 13:51:36 -0700 2008 Added test stuff. [technicalpickles]
directory shoulda_macros/ Fri Mar 20 10:40:15 -0700 2009 we should redirect on failed login, not render new [mjankowski]
directory test/ Sat Mar 07 21:41:46 -0800 2009 deleting known issues file, flashes partial [dancroak]
README.textile

Clearance

Rails authentication for developers who write tests.

We have clearance, Clarence.

Wiki

Most information regarding Clearance is on the Github Wiki.

Integration with Suspenders

Clearance is based on the same conventions and tools as Suspenders If you use it, you already have some configuration mentioned below.

Gem installation (Rails 2.1+)

In config/environment.rb:

config.gem “thoughtbot-clearance”, :lib => ‘clearance’, :source => ‘http://gems.github.com’, :version => ‘0.5.3’

In config/environments/test.rb:

config.gem ‘thoughtbot-shoulda’, :lib => ‘shoulda’, :source => “http://gems.github.com”, :version => ‘2.10.0’ config.gem ‘thoughtbot-factory_girl’, :lib => ‘factory_girl’, :source => “http://gems.github.com”, :version => ‘1.2.0’

Then:

rake gems:install rake gems:unpack rake gems:install RAILS_ENV=test rake gems:unpack RAILS_ENV=test

The generator

Make sure the development database exists and run the generator:

script/generate clearance

A number of files will be created and instructions will be printed.

You may already have some of these files. Don’t worry. You’ll be asked if you want to overwrite them.

Features

If you are using Cucumber on your application Clearance comes with a feature generator:

script/generate clearance_features

All of the files generated should be new with the exception of the features/support/paths.rb file. If you have not modified your paths.rb then you will be okay to replace it with this one. If you need to keep your paths.rb file then you will need to add these locations in your paths.rb manually:

def path_to(page_name) case page_name … when /the sign up page/i new_user_path when /the sign in page/i new_session_path when /the password reset request page/i new_password_path … end

Authors

Clearance was extracted out of Hoptoad. We merged the authentication code from two of thoughtbot’s client’s Rails apps. The following people have made significant contributions, suggestions, and generally improved the library. Thank you!

Dan Croak, Mike Burns, Jason Morrison, Joe Ferris, Eugene Bolshakov, Josh Nichols, Mike Breen, Marcel Görner, Bence Nagy, Ben Mabey, Eloy Duran, Tim Pope, Mihai Anca, & Mark Cornick.