Remove 'project_hidden' state

Compute it using project/context state

Notable change:
todo.hidden? now also returns true if the todo is completed
This commit is contained in:
Carsten Otto 2016-01-24 00:52:23 +01:00
parent 543f49ed8a
commit ed3bca22a4
12 changed files with 66 additions and 106 deletions

View file

@ -13,7 +13,17 @@ class ContextsControllerTest < ActionController::TestCase
get :show, { :id => "1" }
assert_equal 'TRACKS::Context: agenda', assigns['page_title']
end
def test_shows_todos_when_hidden
c = contexts(:agenda)
todos = c.todos.active
assert_equal 6, todos.size
c.hide!
login_as :admin_user
get :show, { :id => '1'}
assert_equal 6, assigns['not_done_todos'].size
end
def test_show_renders_show_template
login_as :admin_user
get :show, { :id => "1" }