Skip to content

Commit

Permalink
Implement acceptance-test blueprint for RFC268.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Dec 17, 2017
1 parent a224e73 commit 02954d2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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 %>');
});
});
26 changes: 26 additions & 0 deletions node-tests/blueprints/acceptance-test-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ describe('Blueprint: acceptance-test', function() {
});
});

describe('with [email protected]', 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([
Expand Down Expand Up @@ -69,5 +82,18 @@ describe('Blueprint: acceptance-test', function() {
.to.not.exist;
});
});

describe('with [email protected]', 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'));
});
});
});
});
});
13 changes: 13 additions & 0 deletions node-tests/fixtures/acceptance-test/qunit-rfc268.js
Original file line number Diff line number Diff line change
@@ -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');
});
});

0 comments on commit 02954d2

Please sign in to comment.