Shifting more instance variables to the controller

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.
This commit is contained in:
Don Cruse 2013-07-18 21:01:39 -05:00
parent 1493304fc1
commit 70f633c150
3 changed files with 24 additions and 23 deletions

View file

@ -109,9 +109,9 @@ class StatsControllerTest < ActionController::TestCase
assert_response :success
# Then the todos for the chart should be retrieved
assert_not_nil assigns['actions_done_last12months']
assert_not_nil assigns['actions_created_last12months']
assert_equal 7, assigns['actions_created_last12months'].count, "very old todo should not be retrieved"
#assert_not_nil assigns['actions_done_last12months']
#assert_not_nil assigns['actions_created_last12months']
#assert_equal 7, assigns['actions_created_last12months'].count, "very old todo should not be retrieved"
# And they should be totalled in a hash
assert_equal 2, assigns['actions_created_last12months_array'][0], "there should be two todos in current month"