[JENKINS-52181] - Create Unit test for the new behavior

This commit is contained in:
Oleg Nenashev authored and GitHub committed 2018-07-31 09:48:15 +02:00
1 parent af5fdc99fe
commit a3576afd23
1 file changed
+11
@@ -80,6 +80,17 @@ public class ConsoleCommandTest {
assertThat(result, hasNoStandardOutput());
assertThat(result.stderr(), containsString("ERROR: No such job 'aProject'"));
}
@Issue("JENKINS-52181")
@Test public void consoleShouldBeAccessibleForUserWithRead() throws Exception {
j.createFreeStyleProject("aProject");
final CLICommandInvoker.Result result = command
.authorizedTo(Jenkins.READ, Job.READ)
.invokeWithArgs("aProject");
assertThat(result, succeeded());
assertThat(result.stdout(), containsString("echo 5"));
}
@Test public void consoleShouldFailWhenProjectDoesNotExist() throws Exception {