diff --git a/core/src/main/resources/hudson/model/View/newJob.jelly b/core/src/main/resources/hudson/model/View/newJob.jelly index fa7f08da6055..f4f89e42af96 100644 --- a/core/src/main/resources/hudson/model/View/newJob.jelly +++ b/core/src/main/resources/hudson/model/View/newJob.jelly @@ -48,7 +48,7 @@ THE SOFTWARE.
- +

${%CopyOption.description}

diff --git a/test/src/test/java/jenkins/model/NewJobCopyFromTest.java b/test/src/test/java/jenkins/model/NewJobCopyFromTest.java new file mode 100644 index 000000000000..3a2150160a8b --- /dev/null +++ b/test/src/test/java/jenkins/model/NewJobCopyFromTest.java @@ -0,0 +1,32 @@ +package jenkins.model; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.MatcherAssert.assertThat; + +import hudson.model.Item; +import java.io.IOException; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.MockAuthorizationStrategy; +import org.xml.sax.SAXException; + +public class NewJobCopyFromTest { + @Rule + public JenkinsRule j = new JenkinsRule(); + + @Test + public void checkLabel() throws IOException, SAXException { + try (JenkinsRule.WebClient wc = j.createWebClient()) { + // no items - validate assertion + assertThat(wc.goTo("newJob").getElementById("from"), is(nullValue())); + + // actual test + j.createFreeStyleProject(); + j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); + j.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy().grant(Item.CREATE, Jenkins.READ).everywhere().toEveryone()); + assertThat(wc.goTo("newJob").getElementById("from"), is(nullValue())); + } + } +}