mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-04 08:18:50 +01:00
fix bug introduced by last commit and add test for it
also refactor check_for_next_todo a bit to depend less on globals
This commit is contained in:
parent
1a2cdc7585
commit
ce671f23f4
8 changed files with 99 additions and 36 deletions
|
|
@ -53,7 +53,7 @@ class ContextTest < Test::Rails::TestCase
|
|||
end
|
||||
|
||||
def test_delete_context_deletes_todos_within_it
|
||||
assert_equal 6, @agenda.todos.count
|
||||
assert_equal 7, @agenda.todos.count
|
||||
agenda_todo_ids = @agenda.todos.collect{|t| t.id }
|
||||
@agenda.destroy
|
||||
agenda_todo_ids.each do |todo_id|
|
||||
|
|
@ -62,11 +62,11 @@ class ContextTest < Test::Rails::TestCase
|
|||
end
|
||||
|
||||
def test_not_done_todos
|
||||
assert_equal 5, @agenda.not_done_todos.size
|
||||
assert_equal 6, @agenda.not_done_todos.size
|
||||
t = @agenda.not_done_todos[0]
|
||||
t.complete!
|
||||
t.save!
|
||||
assert_equal 4, Context.find(@agenda.id).not_done_todos.size
|
||||
assert_equal 5, Context.find(@agenda.id).not_done_todos.size
|
||||
end
|
||||
|
||||
def test_done_todos
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue