There were several problems:
* Time.now returns the systems time, not the users time
* fixtures do not translate dates from timezone to utc, but stores the
date verbatim
* calling a controller will set the timezone to the preference of the
current_user. So it could be changed while you do not realize this. I
fixed the failing test, but problems could be elsewhere
This bug was caused when the chart encountered data outside of its
visible range (i.e., the upper bound of the array size). A test was
added that inserts some data from 2 years and 16 months in the past.
The test failed on the old version, throwing exactly the error in bug
report #1442.
The fix is to check whether or not the value is within the array range
before sending the "+=" operator. With this change, the test passes.
Also removing some instance variables that were never invoked in the
views. This sets up a future refactoring of the method of comptuting
rolling averages, which differs between the two types of "last year"
views being refactored.