From 02954d2ba0df8ee004409f12ff1e33dba64ce743 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Sun, 17 Dec 2017 11:45:51 -0500 Subject: [PATCH] Implement acceptance-test blueprint for RFC268. --- .../tests/acceptance/__name__-test.js | 13 ++++++++++ node-tests/blueprints/acceptance-test-test.js | 26 +++++++++++++++++++ .../fixtures/acceptance-test/qunit-rfc268.js | 13 ++++++++++ 3 files changed, 52 insertions(+) create mode 100644 blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js create mode 100644 node-tests/fixtures/acceptance-test/qunit-rfc268.js diff --git a/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js b/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js new file mode 100644 index 00000000000..b2f9e80bd91 --- /dev/null +++ b/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js @@ -0,0 +1,13 @@ +import { module, test } from 'qunit'; +import { visit, currentURL } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; + +module('<%= friendlyTestName %>', function(hooks) { + setupApplicationTest(hooks); + + test('visiting /<%= dasherizedModuleName %>', async function(assert) { + await visit('/<%= dasherizedModuleName %>'); + + assert.equal(currentURL(), '/<%= dasherizedModuleName %>'); + }); +}); diff --git a/node-tests/blueprints/acceptance-test-test.js b/node-tests/blueprints/acceptance-test-test.js index 1bd139c0ae9..c72ccc3ed75 100644 --- a/node-tests/blueprints/acceptance-test-test.js +++ b/node-tests/blueprints/acceptance-test-test.js @@ -27,6 +27,19 @@ describe('Blueprint: acceptance-test', function() { }); }); + describe('with ember-cli-qunit@4.1.1', function() { + beforeEach(function() { + generateFakePackageManifest('ember-cli-qunit', '4.1.1'); + }); + + it('acceptance-test foo', function() { + return emberGenerateDestroy(['acceptance-test', 'foo'], _file => { + expect(_file('tests/acceptance/foo-test.js')) + .to.equal(fixture('acceptance-test/qunit-rfc268.js')); + }); + }); + }); + describe('with ember-cli-mocha', function() { beforeEach(function() { return modifyPackages([ @@ -69,5 +82,18 @@ describe('Blueprint: acceptance-test', function() { .to.not.exist; }); }); + + describe('with ember-cli-qunit@4.1.1', function() { + beforeEach(function() { + generateFakePackageManifest('ember-cli-qunit', '4.1.1'); + }); + + it('acceptance-test foo', function() { + return emberGenerateDestroy(['acceptance-test', 'foo'], _file => { + expect(_file('tests/acceptance/foo-test.js')) + .to.equal(fixture('acceptance-test/qunit-rfc268.js')); + }); + }); + }); }); }); diff --git a/node-tests/fixtures/acceptance-test/qunit-rfc268.js b/node-tests/fixtures/acceptance-test/qunit-rfc268.js new file mode 100644 index 00000000000..25eab4cf23b --- /dev/null +++ b/node-tests/fixtures/acceptance-test/qunit-rfc268.js @@ -0,0 +1,13 @@ +import { module, test } from 'qunit'; +import { visit, currentURL } from '@ember/test-helpers'; +import { setupApplicationTest } from 'ember-qunit'; + +module('Acceptance | foo', function(hooks) { + setupApplicationTest(hooks); + + test('visiting /foo', async function(assert) { + await visit('/foo'); + + assert.equal(currentURL(), '/foo'); + }); +});