jkrall / analytical

Gem for managing multiple analytics services in your rails app.
MIT License
380 stars 92 forks source link

RSpec view failures #38

Closed indirect closed 11 years ago

indirect commented 12 years ago

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:

    # 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!

sfsekaran commented 11 years ago

Is this still an issue, @indirect? I know you're not necessarily using analytical much anymore, but I'd rather close this if no one else is experiencing any pain from it, or obviously if it's already fixed. Ideally, it would be excellent if you could provide a failing spec.

indirect commented 11 years ago

I don't even remember what the outcome was for this. Since I don't have access to the app that uses analytical anymore, I think closing it is fine.

On Feb 17, 2013, at 9:37 PM, Sathya Sekaran notifications@github.com wrote:

Is this still an issue, @indirect? I know you're not necessarily using analytical much anymore, but I'd rather close this if no one else is experiencing any pain from it, or obviously if it's already fixed. Ideally, it would be excellent if you could provide a failing spec.

\ Reply to this email directly or view it on GitHub.