Skip to content

Commit

Permalink
restore tests for cached not_done counts
Browse files Browse the repository at this point in the history
  • Loading branch information
lrbalt committed Jul 9, 2011
1 parent f2d581d commit e531907
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/functional/todos_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ def test_not_done_counts
assert_equal 1, contexts(:lab).todos.not_completed.count
end

def test_cached_not_done_counts
login_as(:admin_user)
get :index
assert_equal 2, assigns['project_not_done_counts'][projects(:timemachine).id]
assert_equal 3, assigns['context_not_done_counts'][contexts(:call).id]
assert_equal 1, assigns['context_not_done_counts'][contexts(:lab).id]
end

def test_cached_not_done_counts_after_hiding_project
p = Project.find(1)
p.hide!
p.save!
login_as(:admin_user)
get :index
assert_equal nil, assigns['project_not_done_counts'][projects(:timemachine).id]
assert_equal 2, assigns['context_not_done_counts'][contexts(:call).id]
assert_equal nil, assigns['context_not_done_counts'][contexts(:lab).id]
end

def test_tag_is_retrieved_properly
login_as(:admin_user)
get :index
Expand Down

0 comments on commit e531907

Please sign in to comment.