add unit test to validate watcher

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8071 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-04 09:44:11 +00:00
parent 32ed138c53
commit 93603f383a
1 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,13 @@ class WatcherTest < ActiveSupport::TestCase
@issue = Issue.find(1)
end
def test_validate
user = User.find(5)
assert !user.active?
watcher = Watcher.new(:user_id => user.id)
assert !watcher.save
end
def test_watch
assert @issue.add_watcher(@user)
@issue.reload