mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 14:43:08 +03:00
Fix tests
This commit is contained in:
parent
b5995419dc
commit
d5018cbb3a
@ -8,6 +8,7 @@ export default class SettingsDesignRoute extends AdminRoute {
|
||||
@service settings;
|
||||
@service themeManagement;
|
||||
@service ui;
|
||||
@service session;
|
||||
|
||||
model() {
|
||||
// background refresh of preview
|
||||
@ -22,6 +23,16 @@ export default class SettingsDesignRoute extends AdminRoute {
|
||||
]);
|
||||
}
|
||||
|
||||
beforeModel() {
|
||||
super.beforeModel(...arguments);
|
||||
|
||||
const user = this.session.user;
|
||||
|
||||
if (!user.isAdmin) {
|
||||
return this.transitionTo('settings.staff.user', user);
|
||||
}
|
||||
}
|
||||
|
||||
activate() {
|
||||
this.ui.contextualNavMenu = 'design';
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ describe('Acceptance: Settings - Integrations - AMP', function () {
|
||||
await authenticateSession();
|
||||
await visit('/settings/integrations/amp');
|
||||
|
||||
expect(currentURL(), 'currentURL').to.equal('/site');
|
||||
expect(currentURL(), 'currentURL').to.equal('/posts');
|
||||
});
|
||||
|
||||
it('redirects to home page when authenticated as author', async function () {
|
||||
|
@ -29,7 +29,7 @@ describe('Acceptance: Settings - Code-Injection', function () {
|
||||
await authenticateSession();
|
||||
await visit('/settings/code-injection');
|
||||
|
||||
expect(currentURL(), 'currentURL').to.equal('/site');
|
||||
expect(currentURL(), 'currentURL').to.equal('/posts');
|
||||
});
|
||||
|
||||
it('redirects to staff page when authenticated as author', async function () {
|
||||
|
@ -25,7 +25,7 @@ describe('Acceptance: Settings - General', function () {
|
||||
await authenticateSession();
|
||||
await visit('/settings/general');
|
||||
|
||||
expect(currentURL(), 'currentURL').to.equal('/site');
|
||||
expect(currentURL(), 'currentURL').to.equal('/posts');
|
||||
});
|
||||
|
||||
it('redirects to home page when authenticated as author', async function () {
|
||||
|
@ -29,7 +29,7 @@ describe('Acceptance: Settings - Integrations - Custom', function () {
|
||||
await authenticateSession();
|
||||
await visit('/settings/integrations');
|
||||
|
||||
expect(currentURL(), 'currentURL').to.equal('/site');
|
||||
expect(currentURL(), 'currentURL').to.equal('/posts');
|
||||
});
|
||||
|
||||
it('redirects /integrations/ to home page when authenticated as author', async function () {
|
||||
@ -66,7 +66,7 @@ describe('Acceptance: Settings - Integrations - Custom', function () {
|
||||
await authenticateSession();
|
||||
await visit('/settings/integrations/1');
|
||||
|
||||
expect(currentURL(), 'currentURL').to.equal('/site');
|
||||
expect(currentURL(), 'currentURL').to.equal('/posts');
|
||||
});
|
||||
|
||||
it('redirects /integrations/:id/ to home page when authenticated as author', async function () {
|
||||
|
@ -27,7 +27,7 @@ describe('Acceptance: Settings - Labs', function () {
|
||||
await authenticateSession();
|
||||
await visit('/settings/labs');
|
||||
|
||||
expect(currentURL(), 'currentURL').to.equal('/site');
|
||||
expect(currentURL(), 'currentURL').to.equal('/posts');
|
||||
});
|
||||
|
||||
it('redirects to home page when authenticated as author', async function () {
|
||||
|
@ -26,7 +26,7 @@ describe('Acceptance: Settings - Integrations - Slack', function () {
|
||||
await authenticateSession();
|
||||
await visit('/settings/integrations/slack');
|
||||
|
||||
expect(currentURL(), 'currentURL').to.equal('/site');
|
||||
expect(currentURL(), 'currentURL').to.equal('/posts');
|
||||
});
|
||||
|
||||
it('redirects to home page when authenticated as author', async function () {
|
||||
|
@ -29,7 +29,7 @@ describe('Acceptance: Settings - Integrations - Unsplash', function () {
|
||||
await authenticateSession();
|
||||
await visit('/settings/integrations/unsplash');
|
||||
|
||||
expect(currentURL(), 'currentURL').to.equal('/site');
|
||||
expect(currentURL(), 'currentURL').to.equal('/posts');
|
||||
});
|
||||
|
||||
it('redirects to home page when authenticated as author', async function () {
|
||||
|
@ -28,7 +28,7 @@ describe('Acceptance: Settings - Integrations - Zapier', function () {
|
||||
await authenticateSession();
|
||||
await visit('/settings/integrations/zapier');
|
||||
|
||||
expect(currentURL(), 'currentURL').to.equal('/site');
|
||||
expect(currentURL(), 'currentURL').to.equal('/posts');
|
||||
});
|
||||
|
||||
it('redirects to home page when authenticated as author', async function () {
|
||||
|
Loading…
Reference in New Issue
Block a user