java/code/src/com/redhat/rhn/frontend/action/user/CreateUserAction.java | 3 +++ java/code/src/com/redhat/rhn/frontend/action/user/test/CreateUserActionTest.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-)
New commits: commit 03e9c0f564e694af858b54412f0e3acad5220532 Author: Grant Gainey ggainey@redhat.com Date: Sat Feb 22 14:46:57 2014 -0500
Testing createFirstUser() now looks to be forbidden
diff --git a/java/code/src/com/redhat/rhn/frontend/action/user/CreateUserAction.java b/java/code/src/com/redhat/rhn/frontend/action/user/CreateUserAction.java index 2e4e5bd..2bbb7a6 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/user/CreateUserAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/user/CreateUserAction.java @@ -62,6 +62,9 @@ public class CreateUserAction extends RhnAction {
public static final String ACCOUNT_TYPE = "account_type";
+ // Where we should end up if we're told "you're not allowed to do that" + public static final String PERMISSION_ERROR = "/errors/Permission.do"; + // It is ok to maintain an instance because PxtSessionDelegate does not maintain client // state. private PxtSessionDelegate pxtDelegate; diff --git a/java/code/src/com/redhat/rhn/frontend/action/user/test/CreateUserActionTest.java b/java/code/src/com/redhat/rhn/frontend/action/user/test/CreateUserActionTest.java index 84a4a3d..714373e 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/user/test/CreateUserActionTest.java +++ b/java/code/src/com/redhat/rhn/frontend/action/user/test/CreateUserActionTest.java @@ -61,15 +61,15 @@ public class CreateUserActionTest extends RhnPostMockStrutsTestCase { assertTrue(forwardPath.startsWith("/users/ActiveList.do?uid=")); }
+ // This had better fail if there are any users created in this satellite! public void testCreateFirstSatUser() {
- setRequestPathInfo("/newlogin/CreateFirstUserSubmit"); RhnMockDynaActionForm form = fillOutForm("createSatelliteForm", CreateUserAction.TYPE_CREATE_SAT); setActionForm(form); actionPerform(); - this.verifyForward(CreateUserAction.SUCCESS_SAT); + assertTrue(getActualForward().startsWith(CreateUserAction.PERMISSION_ERROR)); }
/**
spacewalk-commits@lists.fedorahosted.org