rspec/rspec-rails — Issue #485: Rspec < 2.8 scaffold view specs create deprecations on rails 3.2.0.rc2
Author: petervandenabeele
Created: 2012-01-16 23:07:28+00:00
State: open

A project created with rails 3.1.3 and rspec 2.7.x and haml with e.g.

```
rails generate scaffold Contact email:string
```
has created a large number of `../contact_app/spec/views/contacts/{new|edit|index|show}.html.haml_spec.rb`
files that have the line

```
3 describe "contacts/new.html.haml" do
```

This problem is resolved for newly created scaffolds in

https://github.com/rspec/rspec-rails/commit/1ccb17cfea27fe189c97cb88619b236e851b6fb9

but for existing projects which migrate to rails 3.2.x a large amount of deprecation warnings may
show up. The style is:

```
contact_app$ rspec
...............................................DEPRECATION WARNING: Passing a template handler in the template name is deprecated. You can simply remove the handler name or pass render :handlers => [:haml] instead. (called from block (2 levels) in at .../contact_app/spec/views/people/new.html.haml_spec.rb:15)
.DEPRECATION WARNING: Passing a template handler in the template name is deprecated. You can simply remove the handler name or pass render :handlers => [:haml] instead. (called from block (2 levels) in at .../contact_app/spec/views/people/index.html.haml_spec.rb:24)
```

The resolution seems clear (change line 3 in the affected view specs).

But, how could we document this so that existing rspec-rails users that migrate up to Rails 3.2
are informed about this issue and the solution. At the same time they will migrate to rspec-rails
2.8, so maybe there is an option there to have an "after gem upgrade message" ?