1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-07 22:45:24 +02:00

Tests for when Anon access is enabled or disabled

This commit is contained in:
zinyando 2016-05-24 18:42:07 +02:00
parent 0db8152143
commit 58ca137911
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,16 @@
import { test, skip } from 'qunit';
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) {
visit('/');
andThen(function() {
assert.equal(currentURL(), '/auth/login');
findWithAssert('#authEmail');
findWithAssert('#authPassword');
findWithAssert('button');
});
});

View file

@ -0,0 +1,24 @@
import { test, skip } from 'qunit';
import moduleForAcceptance from 'documize/tests/helpers/module-for-acceptance';
moduleForAcceptance('Acceptance | Anon access enabled');
test('visiting / when not authenticated and with { allowAnonymousAccess: true } takes user to folder view', function(assert) {
server.create('app-meta', { allowAnonymousAccess: true });
visit('/');
return pauseTest();
andThen(function() {
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
});
});
skip('visiting / when authenticated and with { allowAnonymousAccess: true } takes user to dashboard', function(assert) {
server.create('app-meta', { allowAnonymousAccess: true });
userLogin();
andThen(function() {
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
});
});