mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +03:00
Fixed tests
refs 0503ce5f35
- referenced commit changed `dashboard` to redirect to `site` when logged in user is not an owner or admin
- updated tests to reflect the change
This commit is contained in:
parent
6214e2a187
commit
ff8f45be54
@ -20,14 +20,14 @@ describe('Acceptance: Members', function () {
|
||||
expect(currentURL()).to.equal('/signin');
|
||||
});
|
||||
|
||||
it('redirects non-admins to posts', async function () {
|
||||
it('redirects non-admins to site', async function () {
|
||||
let role = this.server.create('role', {name: 'Editor'});
|
||||
this.server.create('user', {roles: [role]});
|
||||
|
||||
await authenticateSession();
|
||||
await visit('/members');
|
||||
|
||||
expect(currentURL()).to.equal('/dashboard');
|
||||
expect(currentURL()).to.equal('/site');
|
||||
expect(find('[data-test-nav="members"]'), 'sidebar link')
|
||||
.to.not.exist;
|
||||
});
|
||||
|
@ -19,13 +19,13 @@ describe('Acceptance: Setup', function () {
|
||||
await authenticateSession();
|
||||
|
||||
await visit('/setup/one');
|
||||
expect(currentURL()).to.equal('/dashboard');
|
||||
expect(currentURL()).to.equal('/site');
|
||||
|
||||
await visit('/setup/two');
|
||||
expect(currentURL()).to.equal('/dashboard');
|
||||
expect(currentURL()).to.equal('/site');
|
||||
|
||||
await visit('/setup/three');
|
||||
expect(currentURL()).to.equal('/dashboard');
|
||||
expect(currentURL()).to.equal('/site');
|
||||
});
|
||||
|
||||
it('redirects to signin if already set up', async function () {
|
||||
|
@ -22,7 +22,7 @@ describe('Acceptance: Signin', function () {
|
||||
await authenticateSession();
|
||||
await visit('/signin');
|
||||
|
||||
expect(currentURL(), 'current url').to.equal('/dashboard');
|
||||
expect(currentURL(), 'current url').to.equal('/site');
|
||||
});
|
||||
|
||||
describe('when attempting to signin', function () {
|
||||
|
@ -167,7 +167,7 @@ describe('Acceptance: Signup', function () {
|
||||
// submitting sends correct details and redirects to content screen
|
||||
await click('.gh-btn-green');
|
||||
|
||||
expect(currentRouteName()).to.equal('dashboard');
|
||||
expect(currentRouteName()).to.equal('site');
|
||||
});
|
||||
|
||||
it('redirects if already logged in', async function () {
|
||||
@ -185,7 +185,7 @@ describe('Acceptance: Signup', function () {
|
||||
// "1470346017929|kevin+test2@ghost.org|2cDnQc3g7fQTj9nNK4iGPSGfvomkLdXf68FuWgS66Ug="
|
||||
await visit('/signup/MTQ3MDM0NjAxNzkyOXxrZXZpbit0ZXN0MkBnaG9zdC5vcmd8MmNEblFjM2c3ZlFUajluTks0aUdQU0dmdm9ta0xkWGY2OEZ1V2dTNjZVZz0');
|
||||
|
||||
expect(currentRouteName()).to.equal('dashboard');
|
||||
expect(currentRouteName()).to.equal('site');
|
||||
expect(find('.gh-alert-content').textContent).to.have.string('sign out to register');
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user