manual add fix of piglop to prevent todos from staying hidden forever

This commit is contained in:
Reinier Balt 2009-01-21 13:36:26 +01:00
parent 0674c59d54
commit 8ff7afb88c
3 changed files with 214 additions and 177 deletions

View file

@ -136,6 +136,31 @@ describe Todo do
end
end
describe 'when update_state_from_project is called' do
it "should unhide when project is active" do
project = mock_model(Project, :hidden? => false)
todo = Todo.new(:state => 'project_hidden', :project => project)
todo.should be_project_hidden
todo.save
todo.should be_active
end
it "should unhide when project is null" do
todo = Todo.new(:state => 'project_hidden', :project => nil)
todo.should be_project_hidden
todo.save
todo.should be_active
end
it "should hide when project is hidden" do
project = mock_model(Project, :hidden? => true)
todo = Todo.new(:state => 'active', :project => project)
todo.should be_active
todo.save
todo.should be_project_hidden
end
end
describe 'when toggling completion' do
it 'toggles to active when completed' do
todo = create_todo