diff --git a/ui/core/tests/acceptance/authentication-test.js b/ui/core/tests/acceptance/authentication-test.js index 1816d1ae0..b5a4ba249 100644 --- a/ui/core/tests/acceptance/authentication-test.js +++ b/ui/core/tests/acceptance/authentication-test.js @@ -39,6 +39,10 @@ module('Acceptance | authentication', function (hooks) { let authMethodGlobalAuthenticateURL; let orgsURL; let projectsURL; + let usersURL; + let groupsURL; + let rolesURL; + let authMethodsURL; hooks.beforeEach(function () { invalidateSession(); @@ -68,6 +72,10 @@ module('Acceptance | authentication', function (hooks) { authMethodAuthenticateURL = `/scopes/${orgScopeID}/authenticate/${authMethodID}`; orgsURL = `/scopes/global/orgs`; projectsURL = `/scopes/${orgScopeID}/projects`; + usersURL = `/scopes/${orgScopeID}/users`; + groupsURL = `/scopes/${orgScopeID}/groups`; + rolesURL = `/scopes/${orgScopeID}/roles`; + authMethodsURL = `/scopes/${orgScopeID}/auth-methods`; }); test('visiting auth methods authenticate route redirects to first auth method', async function (assert) { @@ -119,6 +127,34 @@ module('Acceptance | authentication', function (hooks) { assert.notOk(currentSession().isAuthenticated); }); + test('visiting users while unauthenticated redirects to first global authenticate method', async function (assert) { + assert.expect(2); + await visit(usersURL); + assert.equal(currentURL(), authMethodGlobalAuthenticateURL); + assert.notOk(currentSession().isAuthenticated); + }); + + test('visiting roles while unauthenticated redirects to first global authenticate method', async function (assert) { + assert.expect(2); + await visit(rolesURL); + assert.equal(currentURL(), authMethodGlobalAuthenticateURL); + assert.notOk(currentSession().isAuthenticated); + }); + + test('visiting groups while unauthenticated redirects to first global authenticate method', async function (assert) { + assert.expect(2); + await visit(groupsURL); + assert.equal(currentURL(), authMethodGlobalAuthenticateURL); + assert.notOk(currentSession().isAuthenticated); + }); + + test('visiting auth methods while unauthenticated redirects to first global authenticate method', async function (assert) { + assert.expect(2); + await visit(authMethodsURL); + assert.equal(currentURL(), authMethodGlobalAuthenticateURL); + assert.notOk(currentSession().isAuthenticated); + }); + test('visiting auth method authenticate route', async function (assert) { assert.expect(1); await visit(authMethodAuthenticateURL);