Manually added patch from piglop. Thanks piglop!

Some specs were removed by 07426ebe54 but they only needed a little
change. Now Todo#update_state_from_project is tested again.
This commit is contained in:
Reinier Balt 2009-01-28 10:11:15 +01:00
parent 8790a9b06d
commit 00e1d2994b

View file

@ -127,6 +127,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.update_state_from_project
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.update_state_from_project
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.update_state_from_project
todo.should be_project_hidden
end
end
it "is deferrable from `active'" do
todo = create_todo
todo.activate!