thoughtbot/clearance — pull request #488 by derekprior (2014-12-19 21:18:45+00:00)
Title: Improve spec generation for RSpec 3 users

Running `rails generate clearance:specs` in an `rspec-rails` 3 project
resulted in broken tests due to the different `spec_helper` files
generated between versions 2 and 3.

In RSpec 3, feature specs should require `rails_helper` rather than
`spec_helper`. Additionally, neither default helper recursively requires
files in `spec/support` as `spec_helper` did under RSpec 2.

To remedy these problems, several changes were made:

1. The specs are now generated from template files which require the
correct helper based on your rspec-rails version.

2. Instead of configuring RSpec globally so we can use FactoryGirl
syntax methods we now explicitly call `FactoryGirl.create` where needed.

3. Instead of relying on Clearance feature spec helpers to be mixed in
to all features we now only do this when the Clearance feature helpers
are explicitly required.

4. Instead of a global `before` to empty ActionMailer deliveries, we now
do this explicitly in the specs that require it.

We're trying to make fewer assumptions about how a user sets up their
test suite, how they use Factory Girl, etc. The result is that if you
use RSpec and Factory Girl, generated specs should just work and should
not screw up any other tests.