diff --git a/ghost/admin/app/components/gh-launch-wizard/connect-stripe.hbs b/ghost/admin/app/components/gh-launch-wizard/connect-stripe.hbs deleted file mode 100644 index 9e3fc7b9ba..0000000000 --- a/ghost/admin/app/components/gh-launch-wizard/connect-stripe.hbs +++ /dev/null @@ -1,123 +0,0 @@ -
-
-
-
-
-

Getting paid

- {{svg-jar "stripe-verified-partner-badge" class="gh-members-stripe-badge"}} -
-

- Stripe is our exclusive direct payments partner. Ghost collects no fees on any payments! If you don’t have a Stripe account yet, you can sign up here. -

-
-
- {{#if this.config.stripeDirect}} -
-
- - - {{#if this.stripePublishableKeyError}}

{{this.stripePublishableKeyError}}

{{/if}} -
-
- - - {{#if this.stripeSecretKeyError}}

{{this.stripeSecretKeyError}}

{{/if}} - - Find your Stripe API keys here » - -
-
-
Skip if you don't want to offer paid subscriptions.
- {{else}} -
- {{!-- Stripe already configured --}} - {{#if this.settings.stripeConnectAccountId}} -
-

Already connected to Stripe

-

- Connected to {{this.settings.stripeConnectDisplayName}} - - {{#unless this.settings.stripeConnectLivemode}} - Test mode - {{/unless}} -

-
- {{#if this.hasActiveStripeSubscriptions}} -

- Cannot disconnect while there are members with active Stripe subscriptions. -

- {{else}} -
- -
- {{/if}} - {{!-- Stripe not yet configured --}} - {{else}} -
-
Generate secure key
-
- Connect with Stripe -
- Test mode -
- -
-
-
-
- - {{#if this.stripeConnectError}}

{{this.stripeConnectError}}

{{/if}} -
-
Skip if you don't want to offer paid subscriptions.
-
- {{/if}} -
- {{/if}} -
-
- - - - {{#if this.saveAndContinueTask.isRunning}} - Saving... - {{else}} - {{if this.settings.stripeConnectAccountId "Continue" "Save and continue"}}{{svg-jar "arrow-right-tail"}} - {{/if}} - -
-
- -{{#if this.showDisconnectStripeConnectModal}} - -{{/if}} diff --git a/ghost/admin/app/components/gh-launch-wizard/connect-stripe.js b/ghost/admin/app/components/gh-launch-wizard/connect-stripe.js deleted file mode 100644 index 15d7f3125a..0000000000 --- a/ghost/admin/app/components/gh-launch-wizard/connect-stripe.js +++ /dev/null @@ -1,203 +0,0 @@ -import Component from '@glimmer/component'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; -import {task, timeout} from 'ember-concurrency'; -import {tracked} from '@glimmer/tracking'; - -const RETRY_PRODUCT_SAVE_POLL_LENGTH = 1000; -const RETRY_PRODUCT_SAVE_MAX_POLL = 15 * RETRY_PRODUCT_SAVE_POLL_LENGTH; - -export default class GhLaunchWizardConnectStripeComponent extends Component { - @service ajax; - @service config; - @service ghostPaths; - @service settings; - @service store; - - @tracked hasActiveStripeSubscriptions = false; - @tracked showDisconnectStripeConnectModal = false; - @tracked stripeConnectTestMode = false; - @tracked stripeConnectError = null; - @tracked stripePublishableKeyError = null; - @tracked stripeSecretKeyError = null; - - get stripeConnectAuthUrl() { - const mode = this.stripeConnectTestMode ? 'test' : 'live'; - return `${this.ghostPaths.url.api('members/stripe_connect')}?mode=${mode}`; - } - - constructor() { - super(...arguments); - this.args.updatePreview(''); - } - - willDestroy() { - super.willDestroy?.(...arguments); - // clear any unsaved settings changes when going back/forward/closing - this.settings.rollbackAttributes(); - } - - @action - setStripeDirectPublicKey(event) { - this.settings.set('stripeProductName', this.settings.get('title')); - this.settings.set('stripePublishableKey', event.target.value); - this.stripePublishableKeyError = null; - } - - @action - setStripeDirectSecretKey(event) { - this.settings.set('stripeProductName', this.settings.get('title')); - this.settings.set('stripeSecretKey', event.target.value); - this.stripeSecretKeyError = null; - } - - @action - toggleStripeConnectTestMode() { - this.stripeConnectTestMode = !this.stripeConnectTestMode; - } - - @action - setStripeConnectIntegrationToken(event) { - this.settings.set('stripeProductName', this.settings.get('title')); - this.settings.set('stripeConnectIntegrationToken', event.target.value); - this.stripeConnectError = null; - } - - calculateDiscount(monthly, yearly) { - if (isNaN(monthly) || isNaN(yearly)) { - return 0; - } - - return monthly ? 100 - Math.floor((yearly / 12 * 100) / monthly) : 0; - } - - getActivePrice(prices, interval, amount, currency) { - return prices.find((price) => { - return ( - price.active && price.amount === amount && price.type === 'recurring' && - price.interval === interval && price.currency.toLowerCase() === currency.toLowerCase() - ); - }); - } - - @task({drop: true}) - *saveTier() { - let pollTimeout = 0; - while (pollTimeout < RETRY_PRODUCT_SAVE_MAX_POLL) { - yield timeout(RETRY_PRODUCT_SAVE_POLL_LENGTH); - - try { - const updatedTier = yield this.tier.save(); - - yield this.settings.save(); - - return updatedTier; - } catch (error) { - if (error.payload?.errors && error.payload.errors[0].code === 'STRIPE_NOT_CONFIGURED') { - pollTimeout += RETRY_PRODUCT_SAVE_POLL_LENGTH; - // no-op: will try saving again as stripe is not ready - continue; - } else { - throw error; - } - } - } - return this.tier; - } - - @task({drop: true}) - *openDisconnectStripeConnectModalTask() { - this.hasActiveStripeSubscriptions = false; - - const url = this.ghostPaths.url.api('/members/') + '?filter=status:paid&limit=0'; - const response = yield this.ajax.request(url); - - if (response?.meta?.pagination?.total !== 0) { - this.hasActiveStripeSubscriptions = true; - return; - } - - this.showDisconnectStripeConnectModal = true; - } - - @action - closeDisconnectStripeModal() { - this.showDisconnectStripeConnectModal = false; - } - - @task - *disconnectStripeConnectIntegrationTask() { - this.disconnectStripeError = false; - const url = this.ghostPaths.url.api('/settings/stripe/connect'); - - yield this.ajax.delete(url); - yield this.settings.reload(); - } - - @task - *saveAndContinueTask() { - if (this.config.get('stripeDirect')) { - if (!this.settings.get('stripePublishableKey')) { - this.stripePublishableKeyError = 'Enter your publishable key to continue'; - } - - if (!this.settings.get('stripeSecretKey')) { - this.stripeSecretKeyError = 'Enter your secret key to continue'; - } - - if (this.stripePublishableKeyError || this.stripeSecretKeyError) { - return false; - } - } else if (!this.settings.get('stripeConnectAccountId') && !this.settings.get('stripeConnectIntegrationToken')) { - this.stripeConnectError = 'Paste your secure key to continue'; - return false; - } - - if (!this.config.get('stripeDirect') && this.settings.get('stripeConnectAccountId')) { - this.args.nextStep(); - return true; - } - - try { - yield this.settings.save(); - - const tiers = yield this.store.query('tier', {filter: 'type:paid', include: 'monthly_price,yearly_price'}); - this.tier = tiers.firstObject; - - if (this.tier) { - this.tier.set('currency', 'usd'); - this.tier.set('monthlyPrice', 500); - this.tier.set('yearlyPrice', 5000); - yield this.saveTier.perform(); - this.settings.set('portalPlans', ['free', 'monthly', 'yearly']); - yield this.settings.save(); - } - - this.pauseAndContinueTask.perform(); - return true; - } catch (error) { - if (error.payload?.errors && error.payload.errors[0].type === 'ValidationError') { - const [validationError] = error.payload.errors; - - if (this.config.get('stripeDirect')) { - if (validationError.context.match(/stripe_publishable_key/)) { - this.stripePublishableKeyError = 'Invalid publishable key'; - } else { - this.stripeSecretKeyError = 'Invalid secret key'; - } - } else { - this.stripeConnectError = 'Invalid secure key'; - } - } - - throw error; - } - } - - @task - *pauseAndContinueTask() { - this.args.refreshPreview(); - yield timeout(500); - this.args.nextStep(); - } -} diff --git a/ghost/admin/app/components/gh-launch-wizard/customise-design.hbs b/ghost/admin/app/components/gh-launch-wizard/customise-design.hbs deleted file mode 100644 index 87a7661fb0..0000000000 --- a/ghost/admin/app/components/gh-launch-wizard/customise-design.hbs +++ /dev/null @@ -1,18 +0,0 @@ -
-
- - -
- -
-
-
\ No newline at end of file diff --git a/ghost/admin/app/components/gh-launch-wizard/customise-design.js b/ghost/admin/app/components/gh-launch-wizard/customise-design.js deleted file mode 100644 index 03b306977e..0000000000 --- a/ghost/admin/app/components/gh-launch-wizard/customise-design.js +++ /dev/null @@ -1,30 +0,0 @@ -import Component from '@glimmer/component'; -import {inject as service} from '@ember/service'; -import {task} from 'ember-concurrency'; - -export default class GhLaunchWizardCustomiseDesignComponent extends Component { - @service notifications; - @service settings; - - willDestroy() { - super.willDestroy?.(...arguments); - this.settings.rollbackAttributes(); - this.settings.errors.remove('accentColor'); - } - - @task - *saveAndContinueTask() { - try { - if (this.settings.errors && this.settings.errors.length !== 0) { - return; - } - yield this.settings.save(); - this.args.nextStep(); - } catch (error) { - if (error) { - this.notifications.showAPIError(error); - throw error; - } - } - } -} diff --git a/ghost/admin/app/components/gh-launch-wizard/finalise.hbs b/ghost/admin/app/components/gh-launch-wizard/finalise.hbs deleted file mode 100644 index c84ab65b15..0000000000 --- a/ghost/admin/app/components/gh-launch-wizard/finalise.hbs +++ /dev/null @@ -1,17 +0,0 @@ -
-
-

All looks good?

-

You are all set up to start creating content, grow an audience and make your first sale!

-

You can further customize your site in Settings.

-
-
- - -
-
\ No newline at end of file diff --git a/ghost/admin/app/components/gh-launch-wizard/finalise.js b/ghost/admin/app/components/gh-launch-wizard/finalise.js deleted file mode 100644 index ffcf1b52b4..0000000000 --- a/ghost/admin/app/components/gh-launch-wizard/finalise.js +++ /dev/null @@ -1,47 +0,0 @@ -import Component from '@glimmer/component'; -import {htmlSafe} from '@ember/template'; -import {inject as service} from '@ember/service'; -import {task} from 'ember-concurrency'; - -export default class GhLaunchWizardFinaliseComponent extends Component { - @service feature; - @service notifications; - @service router; - @service settings; - - willDestroy() { - super.willDestroy?.(...arguments); - // clear any unsaved settings changes when going back/forward/closing - this.settings.rollbackAttributes(); - } - - async saveTier() { - const data = this.args.getData(); - this.tier = data?.tier; - if (this.tier) { - const monthlyAmount = Math.round(data.monthlyAmount * 100); - const yearlyAmount = Math.round(data.yearlyAmount * 100); - const currency = data.currency; - this.tier.set('monthlyPrice', monthlyAmount); - this.tier.set('yearlyPrice', yearlyAmount); - this.tier.set('currency', currency); - const savedTier = await this.tier.save(); - return savedTier; - } - } - - @task - *finaliseTask() { - const data = this.args.getData(); - if (data?.tier) { - yield this.saveTier(); - this.settings.set('editorIsLaunchComplete', true); - yield this.settings.save(); - } - this.router.transitionTo('dashboard'); - this.notifications.showNotification( - 'Launch complete!', - {type: 'success', actions: htmlSafe('Start creating content')} - ); - } -} diff --git a/ghost/admin/app/components/gh-launch-wizard/set-pricing.hbs b/ghost/admin/app/components/gh-launch-wizard/set-pricing.hbs deleted file mode 100644 index 96b724e651..0000000000 --- a/ghost/admin/app/components/gh-launch-wizard/set-pricing.hbs +++ /dev/null @@ -1,169 +0,0 @@ -
- {{#if this.isConnectDisallowed}} -
-
- {{svg-jar "shield-lock"}} -

Your site is not secured

-

Paid memberships through Ghost can only be run on sites secured by SSL (HTTPS vs. HTTP). More information on adding a free SSL Certificate to your Ghost site can be found here.

-
-
-
Generate secure key
-
-
Connect with Stripe
-
- Test mode -
- -
-
-
-
- -
-
-
- {{else}} -
-
-
- -
Plan currency
- - - {{svg-jar "arrow-down-small"}} - -
-
-
-
- -
Monthly price
- -
- - {{this.currency}}/month -
-
-
-
- -
Yearly price
-
- - {{this.currency}}/year -
-
-
-
-
-
- {{#if this.stripePlanError}} -

{{this.stripePlanError}}

- {{/if}} -
- -
-
Plans available at signup
-
- -
-
- -
-
- -
-
-
- {{/if}} - -
- - - {{!-- TODO: reset "failed" state automatically --}} - - {{if this.isHidden "Continue" "Save and continue"}}{{svg-jar "arrow-right-tail"}} - -
-
diff --git a/ghost/admin/app/components/gh-launch-wizard/set-pricing.js b/ghost/admin/app/components/gh-launch-wizard/set-pricing.js deleted file mode 100644 index a7e5ac52f1..0000000000 --- a/ghost/admin/app/components/gh-launch-wizard/set-pricing.js +++ /dev/null @@ -1,209 +0,0 @@ -import Component from '@glimmer/component'; -import envConfig from 'ghost-admin/config/environment'; -import {action} from '@ember/object'; -import {currencies, getCurrencyOptions, getSymbol} from 'ghost-admin/utils/currency'; -import {inject as service} from '@ember/service'; -import {task} from 'ember-concurrency'; -import {tracked} from '@glimmer/tracking'; - -const CURRENCIES = currencies.map((currency) => { - return { - value: currency.isoCode.toLowerCase(), - label: `${currency.isoCode} - ${currency.name}`, - isoCode: currency.isoCode - }; -}); - -export default class GhLaunchWizardSetPricingComponent extends Component { - @service config; - @service membersUtils; - @service settings; - @service store; - - currencies = CURRENCIES; - - @tracked stripeMonthlyAmount = 5; - @tracked stripeYearlyAmount = 50; - @tracked currency = 'usd'; - @tracked isFreeChecked = true; - @tracked isMonthlyChecked = true; - @tracked isYearlyChecked = true; - @tracked stripePlanError = ''; - @tracked tier; - @tracked loadingTier = false; - - get selectedCurrency() { - return this.currencies.findBy('value', this.currency); - } - - get allCurrencies() { - return getCurrencyOptions(); - } - - get isConnectDisallowed() { - const siteUrl = this.config.get('blogUrl'); - - return envConfig.environment !== 'development' && !/^https:/.test(siteUrl); - } - - get isFreeDisabled() { - return this.settings.get('membersSignupAccess') !== 'all'; - } - - willDestroy() { - super.willDestroy?.(...arguments); - // clear any unsaved settings changes when going back/forward/closing - this.args.updatePreview(''); - } - - @action - setup() { - this.fetchDefaultTier.perform(); - this.updatePreviewUrl(); - } - - @action - backStep() { - const tier = this.tier; - const data = this.args.getData() || {}; - this.args.storeData({ - ...data, - tier, - isFreeChecked: this.isFreeChecked, - isMonthlyChecked: this.isMonthlyChecked, - isYearlyChecked: this.isYearlyChecked, - monthlyAmount: this.stripeMonthlyAmount, - yearlyAmount: this.stripeYearlyAmount, - currency: this.currency - }); - this.args.backStep(); - } - - @action - setStripePlansCurrency(event) { - const newCurrency = event.value; - this.currency = newCurrency; - this.updatePreviewUrl(); - } - - @action - toggleFreePlan(event) { - this.isFreeChecked = event.target.checked; - this.updatePreviewUrl(); - } - - @action - toggleMonthlyPlan(event) { - this.isMonthlyChecked = event.target.checked; - this.updatePreviewUrl(); - } - - @action - toggleYearlyPlan(event) { - this.isYearlyChecked = event.target.checked; - this.updatePreviewUrl(); - } - - @action - validateStripePlans() { - this.stripePlanError = undefined; - - try { - const yearlyAmount = this.stripeYearlyAmount; - const monthlyAmount = this.stripeMonthlyAmount; - const symbol = getSymbol(this.currency); - if (!yearlyAmount || yearlyAmount < 1 || !monthlyAmount || monthlyAmount < 1) { - throw new TypeError(`Subscription amount must be at least ${symbol}1.00`); - } - - this.updatePreviewUrl(); - } catch (err) { - this.stripePlanError = err.message; - } - } - - @task - *saveAndContinue() { - if (this.isConnectDisallowed) { - this.args.nextStep(); - } else { - yield this.validateStripePlans(); - - if (this.stripePlanError) { - return false; - } - const tier = this.tier; - const data = this.args.getData() || {}; - this.args.storeData({ - ...data, - tier, - isFreeChecked: this.isFreeChecked, - isMonthlyChecked: this.isMonthlyChecked, - isYearlyChecked: this.isYearlyChecked, - monthlyAmount: this.stripeMonthlyAmount, - yearlyAmount: this.stripeYearlyAmount, - currency: this.currency - }); - this.args.nextStep(); - } - } - - @task({drop: true}) - *fetchDefaultTier() { - const storedData = this.args.getData(); - if (storedData?.tier) { - this.tier = storedData.tier; - - if (storedData.isMonthlyChecked !== undefined) { - this.isMonthlyChecked = storedData.isMonthlyChecked; - } - if (storedData.isYearlyChecked !== undefined) { - this.isYearlyChecked = storedData.isYearlyChecked; - } - if (storedData.isFreeChecked !== undefined) { - this.isFreeChecked = storedData.isFreeChecked; - } - if (storedData.currency !== undefined) { - this.currency = storedData.currency; - } - this.stripeMonthlyAmount = storedData.monthlyAmount; - this.stripeYearlyAmount = storedData.yearlyAmount; - } else { - const tiers = yield this.store.query('tier', {filter: 'type:paid', include: 'monthly_price,yearly_price'}); - this.tier = tiers.firstObject; - - let portalPlans = this.settings.get('portalPlans') || []; - - this.isMonthlyChecked = portalPlans.includes('monthly'); - this.isYearlyChecked = portalPlans.includes('yearly'); - this.isFreeChecked = portalPlans.includes('free'); - - const monthlyPrice = this.tier.get('monthlyPrice'); - const yearlyPrice = this.tier.get('yearlyPrice'); - if (monthlyPrice && monthlyPrice.amount) { - this.stripeMonthlyAmount = (monthlyPrice.amount / 100); - this.currency = monthlyPrice.currency; - } - if (yearlyPrice && yearlyPrice.amount) { - this.stripeYearlyAmount = (yearlyPrice.amount / 100); - } - } - this.updatePreviewUrl(); - } - - updatePreviewUrl() { - const options = { - disableBackground: true, - currency: this.selectedCurrency.value, - monthlyPrice: Math.round(this.stripeMonthlyAmount * 100), - yearlyPrice: Math.round(this.stripeYearlyAmount * 100), - isMonthlyChecked: this.isMonthlyChecked, - isYearlyChecked: this.isYearlyChecked, - isFreeChecked: this.isFreeChecked, - portalPlans: null - }; - - const url = this.membersUtils.getPortalPreviewUrl(options); - this.args.updatePreview(url); - } -} diff --git a/ghost/admin/app/controllers/launch.js b/ghost/admin/app/controllers/launch.js deleted file mode 100644 index 3c9bb9d247..0000000000 --- a/ghost/admin/app/controllers/launch.js +++ /dev/null @@ -1,163 +0,0 @@ -import Controller from '@ember/controller'; -import envConfig from 'ghost-admin/config/environment'; -import {action} from '@ember/object'; -import {inject as service} from '@ember/service'; -import {tracked} from '@glimmer/tracking'; - -const DEFAULT_STEPS = { - 'customise-design': { - title: 'Customise your site', - position: 'Step 1', - next: 'connect-stripe' - }, - 'connect-stripe': { - title: 'Connect to Stripe', - position: 'Step 2', - next: 'set-pricing', - back: 'customise-design', - skip: 'finalise' - }, - 'set-pricing': { - title: 'Set up subscriptions', - position: 'Step 3', - next: 'finalise', - back: 'connect-stripe' - }, - finalise: { - title: 'Launch your site', - position: 'Final step', - back: 'set-pricing' - } -}; -export default class LaunchController extends Controller { - @service config; - @service router; - @service settings; - - queryParams = ['step']; - - @tracked previewGuid = (new Date()).valueOf(); - @tracked previewSrc = ''; - @tracked step = 'customise-design'; - @tracked data = null; - - steps = DEFAULT_STEPS; - - skippedSteps = []; - - constructor(...args) { - super(...args); - const siteUrl = this.config.get('blogUrl'); - - if (envConfig.environment !== 'development' && !/^https:/.test(siteUrl)) { - this.steps = { - 'customise-design': { - title: 'Customise your site', - position: 'Step 1', - next: 'set-pricing' - }, - 'set-pricing': { - title: 'Set up subscriptions', - position: 'Step 2', - next: 'finalise', - back: 'customise-design' - }, - finalise: { - title: 'Launch your site', - position: 'Final step', - back: 'set-pricing' - } - }; - } else { - this.steps = DEFAULT_STEPS; - } - } - - get currentStep() { - return this.steps[this.step]; - } - - @action - storeData(data) { - this.data = data; - } - - @action - getData() { - return this.data; - } - - @action - goToStep(step) { - if (step) { - this.step = step; - } - } - - @action - goNextStep() { - this.step = this.currentStep.next; - } - - @action - goBackStep() { - let step = this.currentStep.back; - - while (this.skippedSteps.includes(step)) { - this.skippedSteps = this.skippedSteps.filter(s => s !== step); - step = this.steps[step].back; - } - - this.step = step; - } - - // TODO: remember when a step is skipped so "back" works as expected - @action - skipStep() { - let step = this.currentStep.next; - let skipToStep = this.currentStep.skip; - - while (step !== skipToStep) { - this.skippedSteps.push(step); - step = this.steps[step].next; - } - - this.step = step; - } - - @action - registerPreviewIframe(element) { - this.previewIframe = element; - } - - @action - refreshPreview() { - this.previewGuid = (new Date()).valueOf(); - } - - @action - updatePreview(url) { - this.previewSrc = url; - } - - @action - replacePreviewContents(html) { - if (this.previewIframe) { - this.previewIframe.contentWindow.document.open(); - this.previewIframe.contentWindow.document.write(html); - this.previewIframe.contentWindow.document.close(); - } - } - - @action - close() { - this.router.transitionTo('dashboard'); - } - - @action - reset() { - this.data = null; - this.step = 'customise-design'; - this.skippedSteps = []; - } -} diff --git a/ghost/admin/app/routes/launch.js b/ghost/admin/app/routes/launch.js deleted file mode 100644 index 68a93bee58..0000000000 --- a/ghost/admin/app/routes/launch.js +++ /dev/null @@ -1,13 +0,0 @@ -import AuthenticatedRoute from 'ghost-admin/routes/authenticated'; -import {inject as service} from '@ember/service'; - -export default class LaunchRoute extends AuthenticatedRoute { - @service session; - - beforeModel() { - super.beforeModel(...arguments); - if (!this.session.user.isOwnerOnly) { - return this.transitionTo('home'); - } - } -} diff --git a/ghost/admin/app/templates/launch.hbs b/ghost/admin/app/templates/launch.hbs deleted file mode 100644 index 20f234a9f4..0000000000 --- a/ghost/admin/app/templates/launch.hbs +++ /dev/null @@ -1,32 +0,0 @@ -
-
-
-
{{this.currentStep.position}}
-

{{this.currentStep.title}}

-
- -
- -
-
- {{component (concat "gh-launch-wizard/" this.step) - nextStep=this.goNextStep - backStep=this.goBackStep - skipStep=this.skipStep - refreshPreview=this.refreshPreview - updatePreview=this.updatePreview - replacePreviewContents=this.replacePreviewContents - storeData=this.storeData - getData=this.getData - }} -
- -
- - - -
-
-
\ No newline at end of file diff --git a/ghost/admin/tests/acceptance/launch-flow-test.js b/ghost/admin/tests/acceptance/launch-flow-test.js deleted file mode 100644 index efaed67497..0000000000 --- a/ghost/admin/tests/acceptance/launch-flow-test.js +++ /dev/null @@ -1,30 +0,0 @@ -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'); - }); - }); -});