Mercurial > hg > soundsoftware-site
comparison test/unit/watcher_test.rb @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | e248c7af89ec |
children |
comparison
equal
deleted
inserted
replaced
1516:b450a9d58aed | 1517:dffacf8a6908 |
---|---|
54 assert Issue.watched_by(@user).include?(@issue) | 54 assert Issue.watched_by(@user).include?(@issue) |
55 end | 55 end |
56 | 56 |
57 def test_watcher_users | 57 def test_watcher_users |
58 watcher_users = Issue.find(2).watcher_users | 58 watcher_users = Issue.find(2).watcher_users |
59 assert_kind_of Array, watcher_users | 59 assert_kind_of Array, watcher_users.collect{|w| w} |
60 assert_kind_of User, watcher_users.first | 60 assert_kind_of User, watcher_users.first |
61 end | 61 end |
62 | 62 |
63 def test_watcher_users_should_not_validate_user | 63 def test_watcher_users_should_not_validate_user |
64 User.update_all("firstname = ''", "id=1") | 64 User.where(:id => 1).update_all("firstname = ''") |
65 @user.reload | 65 @user.reload |
66 assert !@user.valid? | 66 assert !@user.valid? |
67 | 67 |
68 issue = Issue.new(:project => Project.find(1), :tracker_id => 1, :subject => "test", :author => User.find(2)) | 68 issue = Issue.new(:project => Project.find(1), :tracker_id => 1, :subject => "test", :author => User.find(2)) |
69 issue.watcher_users << @user | 69 issue.watcher_users << @user |