From: Jean-Philippe Lang Date: Sun, 15 Apr 2012 15:13:28 +0000 (+0000) Subject: Additional test for Watcher.prune. X-Git-Tag: 2.0.0~190 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9817e1d744eccc1f715564015cde80672906ba3e;p=redmine.git Additional test for Watcher.prune. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9418 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/test/unit/watcher_test.rb b/test/unit/watcher_test.rb index 564cd0503..ed0400a7e 100644 --- a/test/unit/watcher_test.rb +++ b/test/unit/watcher_test.rb @@ -154,4 +154,12 @@ class WatcherTest < ActiveSupport::TestCase assert Issue.find(1).watched_by?(user) assert !Issue.find(4).watched_by?(user) end + + def test_prune_all + user = User.find(9) + Watcher.new(:watchable => Issue.find(4), :user => User.find(9)).save(false) + + assert Watcher.prune > 0 + assert !Issue.find(4).watched_by?(user) + end end