mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-20 22:24:09 +01:00
a previous commit introduced a bug where hiding a project did not hide the todos in it. Fixes #832
This commit is contained in:
parent
8076f4fe72
commit
07426ebe54
5 changed files with 25 additions and 31 deletions
|
|
@ -136,31 +136,6 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue