jkrall/analytical — Issue #38: RSpec view failures
Author: indirect
Created: 2012-01-29 22:23:54+00:00
State: open

In my view specs, templates that included calls to `analytical.event` were causing exceptions. It turns out this was because `ActionView::TestCase::TestController` wasn't inheriting the call to `analytical` that I put in my `ApplicationController`. The easiest fix I found was adding this to my `spec_helper.rb`:

```ruby
# Give TestController an empty list of analytical modules
ActionView::TestCase::TestController.class_eval do
self.analytical_options = {:modules => []}
end
```

Seems like it might be nice for Analytical to provide RSpec integration so that this doesn't have to be debugged and then added by hand. Thanks!