From cc2bc4249cad9f52ae7dbcbc6e42f2e39b554e6e Mon Sep 17 00:00:00 2001 From: Vojtech Juranek Date: Fri, 16 Aug 2013 13:21:53 +0200 Subject: [PATCH] Add test for PR #909 --- test/src/test/java/hudson/model/UserTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/src/test/java/hudson/model/UserTest.java b/test/src/test/java/hudson/model/UserTest.java index a6acfdfa33..44a7d8964b 100644 --- a/test/src/test/java/hudson/model/UserTest.java +++ b/test/src/test/java/hudson/model/UserTest.java @@ -248,6 +248,12 @@ public class UserTest { assertFalse("User should not participate in the last build of project free2.", user.getBuilds().contains(build2)); assertTrue("User should participate in the project free.", user.getProjects().contains(project)); assertFalse("User should not participate in the project free2.", user.getProjects().contains(project2)); + + //JENKINS-16178: build should include also builds scheduled by user + build2.addAction(new CauseAction(new Cause.UserIdCause())); + assertFalse("User should not participate in the last build of project free2.", user.getBuilds().contains(build2)); + assertFalse("Current user should not participate in the last build of project free.", User.current().getBuilds().contains(build)); + assertTrue("Current user should participate in the last build of project free2.", User.current().getBuilds().contains(build2)); } @Test