From 510048178a4cccc2347b9a43585fd4491b8b0d35 Mon Sep 17 00:00:00 2001 From: lrbalt Date: Sun, 2 Mar 2008 20:33:04 +0000 Subject: [PATCH] this patch adds some basic tests for the downdrilling. Also some text is added to the charts on the stats page to show that downdrilling is possible git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@721 a4c988fc-2ded-0310-b66e-134b36920a42 --- .../stats/actions_running_time_data.rhtml | 2 +- .../actions_visible_running_time_data.rhtml | 2 +- .../test/functional/stats_controller_test.rb | 29 +++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/tracks/app/views/stats/actions_running_time_data.rhtml b/tracks/app/views/stats/actions_running_time_data.rhtml index fc561776..9fb1bc17 100755 --- a/tracks/app/views/stats/actions_running_time_data.rhtml +++ b/tracks/app/views/stats/actions_running_time_data.rhtml @@ -1,7 +1,7 @@ &title=Current running time of all uncompleted actions,{font-size:16},& &y_legend=Actions,10,0x736AFF& &y2_legend=Percentage,10,0xFF0000& -&x_legend=Running time of an action (weeks),12,0x736AFF& +&x_legend=Running time of an action (weeks). Click on a bar for more info,11,0x736AFF& &y_ticks=5,10,5& &filled_bar=50,0x9933CC,0x8010A0& &values= diff --git a/tracks/app/views/stats/actions_visible_running_time_data.rhtml b/tracks/app/views/stats/actions_visible_running_time_data.rhtml index 007344cd..1b3c6b69 100755 --- a/tracks/app/views/stats/actions_visible_running_time_data.rhtml +++ b/tracks/app/views/stats/actions_visible_running_time_data.rhtml @@ -1,7 +1,7 @@ &title=Current running time of uncompleted visible actions,{font-size:16},& &y_legend=Actions,10,0x736AFF& &y2_legend=Percentage,10,0xFF0000& -&x_legend=Running time of an action (weeks),12,0x736AFF& +&x_legend=Running time of an action (weeks). Click on a bar for more info,11,0x736AFF& &y_ticks=5,10,5& &filled_bar=50,0x9933CC,0x8010A0& &values= diff --git a/tracks/test/functional/stats_controller_test.rb b/tracks/test/functional/stats_controller_test.rb index 5b9dd441..a3cf9645 100755 --- a/tracks/test/functional/stats_controller_test.rb +++ b/tracks/test/functional/stats_controller_test.rb @@ -62,4 +62,33 @@ class StatsControllerTest < Test::Unit::TestCase assert_equal 2.week.ago.utc.beginning_of_day, assigns['first_action'].created_at end + def test_downdrill + login_as(:admin_user) + + # drill down without parameters + get :show_selected_actions_from_chart + assert_response :not_found + assert_template nil + + # get week 0-1 for actions visible running + get :show_selected_actions_from_chart, :id => 'avrt', :index => 0 + assert_response :success + assert_template "stats/show_selection_from_chart" + + # get week 0 and further for actions visible running + get :show_selected_actions_from_chart, :id => 'avrt_end', :index => 0 + assert_response :success + assert_template "stats/show_selection_from_chart" + + # get week 0-1 for actions running + get :show_selected_actions_from_chart, :id => 'art', :index => 0 + assert_response :success + assert_template "stats/show_selection_from_chart" + + # get week 0 and further for actions running + get :show_selected_actions_from_chart, :id => 'art_end', :index => 0 + assert_response :success + assert_template "stats/show_selection_from_chart" + end + end