Correct typo in variable name

This commit is contained in:
Katrina Owen 2013-02-28 20:34:46 -05:00
parent 1d932ccfe5
commit ce9db80743
5 changed files with 14 additions and 14 deletions

View file

@ -114,8 +114,8 @@ class StatsController < ApplicationController
@actions_completion_time_array = cut_off_array_with_sum(@actions_completed_per_week_array, @count)
@max_actions = @actions_completion_time_array.max
# get percentage done cummulative
@cumm_percent_done = convert_to_cummulative_array(@actions_completion_time_array, @actions_completion_time.count)
# get percentage done cumulative
@cum_percent_done = convert_to_cumulative_array(@actions_completion_time_array, @actions_completion_time.count)
render :layout => false
end
@ -134,8 +134,8 @@ class StatsController < ApplicationController
@actions_running_time_array = cut_off_array_with_sum(@actions_running_per_week_array, @count)
@max_actions = @actions_running_time_array.max
# get percentage done cummulative
@cumm_percent_done = convert_to_cummulative_array(@actions_running_time_array, @actions_running_time.count )
# get percentage done cumulative
@cum_percent_done = convert_to_cumulative_array(@actions_running_time_array, @actions_running_time.count )
render :layout => false
end
@ -163,8 +163,8 @@ class StatsController < ApplicationController
@actions_running_time_array = cut_off_array_with_sum(@actions_running_per_week_array, @count)
@max_actions = @actions_running_time_array.max
# get percentage done cummulative
@cumm_percent_done = convert_to_cummulative_array(@actions_running_time_array, @actions_running_time.count )
# get percentage done cumulative
@cum_percent_done = convert_to_cumulative_array(@actions_running_time_array, @actions_running_time.count )
render :layout => false
end
@ -669,10 +669,10 @@ class StatsController < ApplicationController
return Array.new(cut_off){|i| array[i]||0}
end
def convert_to_cummulative_array(array, max)
def convert_to_cumulative_array(array, max)
# calculate fractions
a = Array.new(array.size){|i| array[i]*100.0/max}
# make cummulative
# make cumulative
1.upto(array.size-1){ |i| a[i] += a[i-1] }
return a
end

View file

@ -11,7 +11,7 @@ time_labels[@count] = "> #{@count}"
&filled_bar=50,0x9933CC,0x8010A0&
&values=<%= @actions_completion_time_array.join(",")%>&
&line_2=2,0xFF0000&
&values_2=<%= @cumm_percent_done.join(",")%>&
&values_2=<%= @cum_percent_done.join(",")%>&
&x_labels=<%= time_labels.join(",")%>&
&y_min=0&
<%

View file

@ -15,7 +15,7 @@ time_labels[@count] = "> #{@count}"
&values=<%= @actions_running_time_array.join(",") -%>&
&links=<%= url_labels.join(",") %>&
&line_2=2,0xFF0000&
&values_2=<%= @cumm_percent_done.join(",") %>&
&values_2=<%= @cum_percent_done.join(",") %>&
&x_labels=<%= time_labels.join(",") %> &
&y_min=0&
<%

View file

@ -15,7 +15,7 @@ time_labels[@count] = "> #{@count}"
&values=<%= @actions_running_time_array.join(",") -%>&
&links=<%= url_labels.join(",") %>&
&line_2=2,0xFF0000&
&values_2=<%= @cumm_percent_done.join(",") -%>&
&values_2=<%= @cum_percent_done.join(",") -%>&
&x_labels=<%= time_labels.join(",")%>&
&y_min=0&
<%

View file

@ -188,7 +188,7 @@ class StatsControllerTest < ActionController::TestCase
assert_equal 3, assigns['max_actions'], "3 completed within one week"
assert_equal 11, assigns['actions_completion_time_array'].size, "there should be 10 weeks of data + 1 for the rest"
assert_equal 1, assigns['actions_completion_time_array'][10], "there is one completed todo after the 10 weeks cut_off"
assert_equal 100.0, assigns['cumm_percent_done'][10], "cummulative percentage should add up to 100%"
assert_equal 100.0, assigns['cum_percent_done'][10], "cumulative percentage should add up to 100%"
end
def test_actions_running_time_data
@ -207,7 +207,7 @@ class StatsControllerTest < ActionController::TestCase
assert_equal 2, assigns['max_actions'], "2 actions running long together"
assert_equal 18, assigns['actions_running_time_array'].size, "there should be 17 weeks ( < cut_off) of data + 1 for the rest"
assert_equal 1, assigns['actions_running_time_array'][17], "there is one running todos in week 17 and zero after 17 weeks ( < cut off; ) "
assert_equal 100.0, assigns['cumm_percent_done'][17], "cummulative percentage should add up to 100%"
assert_equal 100.0, assigns['cum_percent_done'][17], "cumulative percentage should add up to 100%"
end
def test_actions_open_per_week_data
@ -247,7 +247,7 @@ class StatsControllerTest < ActionController::TestCase
assert_equal 1, assigns['actions_running_time_array'][0], "there is one running todos and one deferred todo created in week 1"
assert_equal 18, assigns['actions_running_time_array'].size, "there should be 17 weeks ( < cut_off) of data + 1 for the rest"
assert_equal 1, assigns['actions_running_time_array'][17], "there is one running todos in week 17 and zero after 17 weeks ( < cut off; ) "
assert_equal 100.0, assigns['cumm_percent_done'][17], "cummulative percentage should add up to 100%"
assert_equal 100.0, assigns['cum_percent_done'][17], "cumulative percentage should add up to 100%"
end
def test_context_total_actions_data