rspec/rspec-rails — pull request #829 by JonRowe (2013-09-29 12:58:11+00:00)
Title: Run before(:all) hooks for rails magic example groups

We automagically configure ExampleGroup types for the various sets of Rails
helpers, however in 2.14 and master ATM these incorrectly pickup configured
helpers. E.g. a `before(:all, :type => :model)` will not run for a spec in
`spec/models` unless the type is set manually.

This is because `rspec-core` configures hooks based on their current metadata
and not on any metadata set later on. The alternative approach would be to
reload the global hooks from config when the metadata is changed in rspec-core
but this fixes #825 for now.

Note that manually specifying type is not affected, nor are any child groups
or examples. It is only the top level group that is affected.

Thoughts? /cc @alindeman @myronmarston