This commit is contained in:
Carsten Otto 2015-03-16 00:03:34 +01:00
parent 5718eac5c3
commit 0edc263c7e
3 changed files with 11 additions and 13 deletions

View file

@ -93,10 +93,9 @@ class TodoTest < ActiveSupport::TestCase
assert_equal 1, @not_completed3.successors.count
# 1 -> 3 -> 2 -> 1 == circle
@not_completed3.add_predecessor(@not_completed1)
assert !@not_completed3.valid?
error_msg = "Adding ''Call Bill Gates to find out how much he makes per day' <'agenda'; 'Make more money than Billy Gates'>' would create a circular dependency"
assert_equal error_msg, @not_completed3.errors["Depends on:"][0]
assert_raises ActiveRecord::RecordInvalid do
@not_completed3.add_predecessor(@not_completed1)
end
end
def test_defer_an_existing_todo