chore: add unauthenticated redirect test
This commit is contained in:
1 file changed
+9
@@ -37,6 +37,7 @@ module('Acceptance | authentication', function (hooks) {
|
||||
let authenticateURL;
|
||||
let authMethodAuthenticateURL;
|
||||
let authMethodGlobalAuthenticateURL;
|
||||
let changePasswordURL;
|
||||
let orgsURL;
|
||||
let projectsURL;
|
||||
let usersURL;
|
||||
@@ -70,6 +71,7 @@ module('Acceptance | authentication', function (hooks) {
|
||||
authenticateURL = `/scopes/${orgScopeID}/authenticate`;
|
||||
authMethodGlobalAuthenticateURL = `/scopes/global/authenticate/${globalAuthMethodID}`;
|
||||
authMethodAuthenticateURL = `/scopes/${orgScopeID}/authenticate/${authMethodID}`;
|
||||
changePasswordURL = `/account/change-password`;
|
||||
orgsURL = `/scopes/global/orgs`;
|
||||
projectsURL = `/scopes/${orgScopeID}/projects`;
|
||||
usersURL = `/scopes/${orgScopeID}/users`;
|
||||
@@ -113,6 +115,13 @@ module('Acceptance | authentication', function (hooks) {
|
||||
assert.notOk(currentSession().isAuthenticated);
|
||||
});
|
||||
|
||||
test('visiting change password while unauthenticated redirects to first global authenticate method', async function (assert) {
|
||||
assert.expect(2);
|
||||
await visit(changePasswordURL);
|
||||
assert.equal(currentURL(), authMethodGlobalAuthenticateURL);
|
||||
assert.notOk(currentSession().isAuthenticated);
|
||||
});
|
||||
|
||||
test('visiting orgs while unauthenticated redirects to first global authenticate method', async function (assert) {
|
||||
assert.expect(2);
|
||||
await visit(orgsURL);
|
||||
|
||||
Reference in new issue
Block a user