1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-08 15:05:28 +02:00

Add SSO test

This commit is contained in:
zinyando 2016-07-05 16:52:20 +02:00
parent 881da18e8a
commit e26108b90b
6 changed files with 67 additions and 57 deletions

View file

@ -3,7 +3,6 @@ import moduleForAcceptance from 'documize/tests/helpers/module-for-acceptance';
moduleForAcceptance('Acceptance | Anon access disabled');
test('visiting / when not authenticated and with { allowAnonymousAccess: false } takes user to login', function (assert) {
server.create('meta', { allowAnonymousAccess: false });
server.createList('folder', 2);

View file

@ -12,7 +12,7 @@ test('visiting / when not authenticated and with { allowAnonymousAccess: true }
andThen(function () {
assert.equal(find('.login').length, 1, 'Login button is displayed');
assert.equal(find('.documents-list .document').length, 2, '2 document displayed');
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Dashboard and public spaces are displayed without being signed in');
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Dashboard and public spaces are displayed without being signed in');
});
});
@ -23,13 +23,13 @@ test('visiting / when authenticated and with { allowAnonymousAccess: true } take
andThen(function () {
assert.equal(find('.login').length, 1, 'Login button is displayed');
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Dashboard displayed without being signed in');
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Dashboard displayed without being signed in');
});
userLogin();
andThen(function () {
assert.equal(find('.login').length, 0, 'Login button is not displayed');
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Dashboard is displayed after user is signed in');
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Dashboard is displayed after user is signed in');
});
});

View file

@ -13,7 +13,7 @@ test('visiting /auth/login and logging in', function(assert) {
click('button');
andThen(function () {
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Login successfull');
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Login successfull');
});
});
@ -25,6 +25,18 @@ test('logging out a user', function(assert) {
visit('/auth/logout');
andThen(function () {
assert.equal(currentURL(), '/auth/login', 'Login successfull');
assert.equal(currentURL(), '/auth/login', 'Logging out successfull');
});
});
test('sso login', function (assert) {
server.create('meta', { allowAnonymousAccess: false });
server.createList('folder', 2);
userLogin();
visit('/auth/sso/OmJyaXpkaWdpdGFsQGdtYWlsLmNvbTp6aW55YW5kbzEyMw==');
andThen(function () {
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Login successfull');
});
});

View file

@ -107,7 +107,6 @@ test('sharing a space', function(assert) {
});
});
// Test will pass after moving to factories
test('changing space permissions', function (assert) {
server.create('meta', { allowAnonymousAccess: false });