drapergem/draper — pull request #430 by haines (2013-01-19 22:18:20+00:00)
Title: Fast specs

[a039671](https://github.com/haines/draper/commit/a039671202b3faa6221daafa60564e123ab7cb8e) adds a `Draper::ViewContext.test_strategy` method. The default setting is `test_strategy :full`, which retains the current behaviour (create an `ApplicationController` and use its view context in the tests).

Using `test_strategy :fast` eliminates this dependency and instead uses a subclass of `ActionView::Base`, allowing decorators to be tested in isolation as discussed in #424.

If some of the application's helpers are required, they can be selectively included by passing a block:

```ruby
Draper::ViewContext.test_strategy :fast do
include ApplicationHelper
end
```

I also fixed a minor bug ([3d07cb3](https://github.com/haines/draper/commit/3d07cb387b1cae6f97897dfb85512e30f5e888e9)) which potentially introduces order dependencies into tests. The view context is set in controller and mailer specs but not cleared afterwards; decorator specs executed subsequently will use that view context rather than building one.