fix case when there are no tags places on todos, the stats page would fail. Fixes #822.

Thanks Walter for finding this one
This commit is contained in:
Reinier Balt 2009-01-15 22:13:22 +01:00
parent 278c7310c1
commit 8cdae83014
2 changed files with 18 additions and 1 deletions

View file

@ -90,5 +90,21 @@ class StatsControllerTest < Test::Unit::TestCase
assert_response :success
assert_template "stats/show_selection_from_chart"
end
def test_stats_render_when_tasks_have_no_taggings
login_as(:admin_user)
# using the default fixtures, todos have tags
get :index
assert_response :success
# clear taggings table and render again
taggings = Tagging.find(:all)
taggings.each do |t|
t.delete
end
get :index
assert_response :success
end
end