Skip to content

Commit 6391313

Browse files
committed
add test for #403
1 parent a5edbcd commit 6391313

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

test/fixtures/.yo-rc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"uirouter": true,
1414
"socketio": true,
1515
"mongoose": true,
16-
"auth": true
16+
"auth": true,
17+
"googleAuth": true
1718
}
1819
}
1920
}

test/test-file-creation.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,34 @@ describe('angular-fullstack generator', function () {
389389
gen.run({}, function () {
390390
helpers.assertFile([
391391
'client/app/main/main.less',
392-
'client/app/main/main.coffee'
392+
'client/app/main/main.coffee',
393+
'server/auth/google/passport.js'
393394
]);
394395
done();
395396
});
396397
});
397398

399+
it('should add oauth option if existing config had oauth strategy selected', function(done) {
400+
this.timeout(60000);
401+
fs.copySync(__dirname + '/fixtures/.yo-rc.json', __dirname + '/temp/.yo-rc.json');
402+
var gen = helpers.createGenerator('angular-fullstack:app', [
403+
'../../app',
404+
[
405+
helpers.createDummyGenerator(),
406+
'ng-component:app'
407+
]
408+
]);
409+
gen.options['skip-install'] = true;
410+
helpers.mockPrompt(gen, {
411+
skipConfig: true
412+
});
413+
gen.run({}, function () {
414+
var yoConfig = require(__dirname + '/temp/.yo-rc.json');
415+
expect(yoConfig['generator-angular-fullstack'].filters.oauth).to.be.true;
416+
done();
417+
});
418+
});
419+
398420
it('should generate expected files', function (done) {
399421
gen.run({}, function () {
400422
helpers.assertFile(genFiles(defaultOptions));

0 commit comments

Comments
 (0)