github.com/elliott5/community@v0.14.1-0.20160709191136-823126fb026a/app/tests/acceptance/anon-access-disabled-test.js (about)

     1  // Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
     2  //
     3  // This software (Documize Community Edition) is licensed under 
     4  // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
     5  //
     6  // You can operate outside the AGPL restrictions by purchasing
     7  // Documize Enterprise Edition and obtaining a commercial license
     8  // by contacting <sales@documize.com>. 
     9  //
    10  // https://documize.com
    11  
    12  import { test } from 'qunit';
    13  import moduleForAcceptance from 'documize/tests/helpers/module-for-acceptance';
    14  
    15  moduleForAcceptance('Acceptance | Anon access disabled');
    16  
    17  test('visiting / when not authenticated and with { allowAnonymousAccess: false } takes user to login', function (assert) {
    18  	server.create('meta', { allowAnonymousAccess: false });
    19  	server.createList('folder', 2);
    20  	visit('/');
    21  
    22  	andThen(function () {
    23  		assert.equal(currentURL(), '/auth/login');
    24  		findWithAssert('#authEmail');
    25  		findWithAssert('#authPassword');
    26  		findWithAssert('button');
    27  	});
    28  });