Permalink
Browse files

Add new generators.

  • Loading branch information...
1 parent e89f2eb commit fc42eb9f24cd206341e338b485f5b69dd37591c9 @paulmillr paulmillr committed Oct 8, 2012
View
2 generators/collection/generator.json
@@ -2,7 +2,7 @@
"files": [
{
"from": "collection.coffee.hbs",
- "to": "app/models/{{name}}.coffee"
+ "to": "app/models/{{pluralName}}.coffee"
}
],
"dependencies": [
View
12 generators/collection_test/collection_test.coffee.hbs
@@ -0,0 +1,12 @@
+Collection = require 'models/base/collection'
+{{#camelize}}{{name}}{{/camelize}} = require 'models/{{name}}'
+{{#camelize}}{{pluralName}}{{/camelize}} = require 'models/{{pluralName}}'
+
+describe '{{#camelize}}{{name}}{{/camelize}}', ->
+ beforeEach ->
+ @model = new {{#camelize}}{{name}}{{/camelize}}()
+ @collection = new {{#camelize}}{{pluralName}}{{/camelize}}()
+
+ afterEach ->
+ @model.dispose()
+ @collection.dispose()
View
2 generators/collection_test/generator.json
@@ -2,7 +2,7 @@
"files": [
{
"from": "collection_test.coffee.hbs",
- "to": "test/models/{{name}}_test.coffee"
+ "to": "test/models/{{pluralName}}_test.coffee"
}
],
"dependencies": []
View
4 generators/controller_test/controller_test.coffee.hbs
@@ -1,5 +1,5 @@
-{{#camelize}}{{name}}{{/camelize}} = require 'models/{{name}}'
+{{#camelize}}{{name}}{{/camelize}} = require 'controllers/{{name}}'
describe '{{#camelize}}{{name}}{{/camelize}}', ->
beforeEach ->
- @model = new {{#camelize}}{{name}}{{/camelize}}()
+ @controller = new {{#camelize}}{{name}}{{/camelize}}()
View
2 generators/model_test/generator.json
@@ -2,7 +2,7 @@
"files": [
{
"from": "model_test.coffee.hbs",
- "to": "test/models/{{name}}.coffee"
+ "to": "test/models/{{name}}_test.coffee"
}
],
"dependencies": []
View
2 generators/page_view/page_view.coffee.hbs
@@ -1,5 +1,5 @@
PageView = require 'views/base/page_view'
template = require 'views/templates/{{name}}_page'
-module.exports = class {{#camelize}}{{name}}{{/camelize}}PageView extends View
+module.exports = class {{#camelize}}{{name}}{{/camelize}}PageView extends PageView
template: template
View
2 generators/view_test/generator.json
@@ -2,7 +2,7 @@
"files": [
{
"from": "view_test.coffee.hbs",
- "to": "test/views/{{name}}_view.coffee"
+ "to": "test/views/{{name}}_view_test.coffee"
}
],
"dependencies": []

0 comments on commit fc42eb9

Please sign in to comment.