Skip to content

Commit

Permalink
chore(tests): refactor appname substitution test
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias authored and eddiemonge committed Feb 17, 2016
1 parent a0c8752 commit 7436702
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 72 deletions.
59 changes: 59 additions & 0 deletions test/app-with-appname.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
'use strict';

var path = require('path');
var helpers = require('yeoman-test');
var assert = require('yeoman-assert');


describe('angular:app appName', function () {
beforeEach(function (done) {
helpers
.run(require.resolve('../app'))
.withGenerators([
require.resolve('../common'),
require.resolve('../controller'),
require.resolve('../main'),
[helpers.createDummyGenerator(), 'karma:app']
])
.withOptions({
'appPath': 'app',
'skip-welcome-message': true,
'skip-message': true
})
.withArguments(['upperCaseBug'])
.withPrompts({
compass: true,
bootstrap: true,
compassBootstrap: true,
modules: []
})
.on('end', done);
});

it('generates the same appName in every file', function () {
assert.file([
'app/scripts/app.js',
'app/scripts/controllers/main.js',
'app/index.html',
'test/spec/controllers/main.js'
]);

assert.fileContent(
'app/scripts/app.js',
/module\('upperCaseBugApp'/
);
assert.fileContent(
'app/scripts/controllers/main.js',
/module\('upperCaseBugApp'/
);
assert.fileContent(
'test/spec/controllers/main.js',
/module\('upperCaseBugApp'/
);

assert.fileContent(
'app/index.html',
/ng-app="upperCaseBugApp"/
);
});
});
File renamed without changes.
72 changes: 0 additions & 72 deletions test/test-appname-substitution.js

This file was deleted.

0 comments on commit 7436702

Please sign in to comment.