mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 22:01:49 +03:00
5092e936cc
refs 6a14087ccc
- `super()` is needed in `beforeModel()` hook so that the AuthenticatedRoute redirect can occur
- launch wizard acceptance test needs to use an Owner user because Admins don't have access
31 lines
1007 B
JavaScript
31 lines
1007 B
JavaScript
import {authenticateSession} from 'ember-simple-auth/test-support';
|
|
import {currentURL, visit} from '@ember/test-helpers';
|
|
import {describe, it} from 'mocha';
|
|
import {expect} from 'chai';
|
|
import {setupApplicationTest} from 'ember-mocha';
|
|
import {setupMirage} from 'ember-cli-mirage/test-support';
|
|
|
|
describe('Acceptance: Launch flow', function () {
|
|
const hooks = setupApplicationTest();
|
|
setupMirage(hooks);
|
|
|
|
it('is not accessible when logged out', async function () {
|
|
await visit('/launch');
|
|
expect(currentURL()).to.equal('/signin');
|
|
});
|
|
|
|
describe('when logged in', function () {
|
|
beforeEach(async function () {
|
|
let role = this.server.create('role', {name: 'Owner'});
|
|
this.server.create('user', {roles: [role]});
|
|
|
|
return await authenticateSession();
|
|
});
|
|
|
|
it('can visit /launch', async function () {
|
|
await visit('/launch');
|
|
expect(currentURL()).to.equal('/launch');
|
|
});
|
|
});
|
|
});
|