]> source.dussan.org Git - redmine.git/commitdiff
Additional test for Watcher.prune.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 15 Apr 2012 15:13:28 +0000 (15:13 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 15 Apr 2012 15:13:28 +0000 (15:13 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9418 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/watcher_test.rb

index 564cd0503711bc3088110faf15ef7a9529496178..ed0400a7e104ac0432c362731bde3cc72ba7bb6b 100644 (file)
@@ -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