diff --git a/factory/index.js b/factory/index.js index 71496e5bf..0dd9610eb 100644 --- a/factory/index.js +++ b/factory/index.js @@ -12,7 +12,7 @@ util.inherits(Generator, ScriptBase); Generator.prototype.createServiceFiles = function createServiceFiles() { this.generateSourceAndTest( 'service/factory', - 'spec/service', + 'spec/factory', 'services', this.options['skip-add'] || false ); diff --git a/templates/coffeescript-min/spec/factory.coffee b/templates/coffeescript-min/spec/factory.coffee new file mode 100644 index 000000000..2f4c371c8 --- /dev/null +++ b/templates/coffeescript-min/spec/factory.coffee @@ -0,0 +1,14 @@ +'use strict' + +describe 'Service: <%= cameledName %>', () -> + + # load the service's module + beforeEach module '<%= scriptAppName %>' + + # instantiate service + <%= cameledName %> = {} + beforeEach inject (_<%= cameledName %>_) -> + <%= cameledName %> = _<%= cameledName %>_ + + it 'should do something', () -> + expect(!!<%= cameledName %>).toBe true diff --git a/templates/coffeescript/spec/factory.coffee b/templates/coffeescript/spec/factory.coffee new file mode 100644 index 000000000..2f4c371c8 --- /dev/null +++ b/templates/coffeescript/spec/factory.coffee @@ -0,0 +1,14 @@ +'use strict' + +describe 'Service: <%= cameledName %>', () -> + + # load the service's module + beforeEach module '<%= scriptAppName %>' + + # instantiate service + <%= cameledName %> = {} + beforeEach inject (_<%= cameledName %>_) -> + <%= cameledName %> = _<%= cameledName %>_ + + it 'should do something', () -> + expect(!!<%= cameledName %>).toBe true diff --git a/templates/javascript-min/spec/factory.js b/templates/javascript-min/spec/factory.js new file mode 100644 index 000000000..4394c2d0b --- /dev/null +++ b/templates/javascript-min/spec/factory.js @@ -0,0 +1,18 @@ +'use strict'; + +describe('Service: <%= cameledName %>', function () { + + // load the service's module + beforeEach(module('<%= scriptAppName %>')); + + // instantiate service + var <%= cameledName %>; + beforeEach(inject(function(_<%= cameledName %>_) { + <%= cameledName %> = _<%= cameledName %>_; + })); + + it('should do something', function () { + expect(!!<%= cameledName %>).toBe(true); + }); + +}); diff --git a/templates/javascript/spec/factory.js b/templates/javascript/spec/factory.js new file mode 100644 index 000000000..1e0c27c21 --- /dev/null +++ b/templates/javascript/spec/factory.js @@ -0,0 +1,18 @@ +'use strict'; + +describe('Service: <%= cameledName %>', function () { + + // load the service's module + beforeEach(module('<%= scriptAppName %>')); + + // instantiate service + var <%= cameledName %>; + beforeEach(inject(function (_<%= cameledName %>_) { + <%= cameledName %> = _<%= cameledName %>_; + })); + + it('should do something', function () { + expect(!!<%= cameledName %>).toBe(true); + }); + +});