Repository: abuiles/ember-watson
Pull request #57 (2015-07-01 06:11:59)

[BUGFIX] Fix typo in new command.


Patch:
diff --git a/README.md b/README.md
index 5772385..d388f2a 100644
--- a/README.md
+++ b/README.md
@@ -38,13 +38,11 @@ want to convert code somewhere different to `app/`.
 
 For more info about this please refer to the following PR [Encourage decorator-style Ember.computed/Ember.observer](https://github.com/emberjs/guides/pull/110)
 
-#### `ember watson:convert-ember-data-async-false-relationships`
+### `ember watson:convert-ember-data-async-false-relationships`
 
-In Ember Data 2.0 relationships will be asynchronous by default. Sync relationships will still be supported but you will need to manually opt into them by setting { async: false } on your relationships. This task adds an explicit `async: false` options to all `belongsTo` and `hasMany` that
+Adds an explicit `async: false` options to all `belongsTo` and `hasMany` that
 either have no options or its options does not contain an explicit async value.
 
-For more information, read [ember-data 1.13 release notes](http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_async-relationships)
-
 #### `ember watson:convert-ember-data-model-lookups`
 
 This changes the way model lookups happen when working with Ember
diff --git a/addon/commands/convert-resource-router-mapping.js b/addon/commands/convert-resource-router-mapping.js
index b3b3ef3..72ae41d 100644
--- a/addon/commands/convert-resource-router-mapping.js
+++ b/addon/commands/convert-resource-router-mapping.js
@@ -12,6 +12,6 @@ module.exports = {
   ],
   run: function(commandOptions, rawArgs) {
     var path = rawArgs[0] ||  'app/router.js';
-    watson.transformResourceRouteMapping(path);
+    watson.transformResourceRouterMapping(path);
   }
 };


Test patch:
diff --git a/tests/commands-test.js b/tests/commands-test.js
index c8a8d32..ea45285 100644
--- a/tests/commands-test.js
+++ b/tests/commands-test.js
@@ -7,6 +7,7 @@ var transformEmberDataModelLookupsCalledWith;
 var transformEmberDataAsyncFalseRelationshipsCalledWith;
 var transformPrototypeExtensionsCalledWith;
 var transformQUnitTestCalledWith;
+var transformResourceRouterMappingCalledWith;
 
 proxyquire('../addon/commands/convert-ember-data-model-lookups', {
   '../../index': Mock
@@ -24,6 +25,10 @@ proxyquire('../addon/commands/upgrade-qunit-tests', {
   '../../index': Mock
 });
 
+proxyquire('../addon/commands/convert-resource-router-mapping', {
+  '../../index': Mock
+});
+
 function Mock() {}
 
 Mock.prototype.transformEmberDataModelLookups = function() {
@@ -42,6 +47,10 @@ Mock.prototype.transformQUnitTest = function () {
   transformQUnitTestCalledWith = Array.prototype.slice.apply(arguments);
 };
 
+Mock.prototype.transformResourceRouterMapping = function () {
+  transformResourceRouterMappingCalledWith = Array.prototype.slice.apply(arguments);
+};
+
 describe('Commands:', function () {
 
   afterEach(function () {
@@ -49,6 +58,7 @@ describe('Commands:', function () {
     transformEmberDataAsyncFalseRelationshipsCalledWith = null;
     transformPrototypeExtensionsCalledWith = null;
     transformQUnitTestCalledWith = null;
+    transformResourceRouterMappingCalledWith = null;
   });
 
   it('convert-ember-data-model-lookups calls the correct transform', function () {
@@ -90,4 +100,20 @@ describe('Commands:', function () {
     Command.run({}, ['other-dir']);
     assert.deepEqual(transformQUnitTestCalledWith , ['other-dir']);
   });
+
+  it('convert-resource-router-mapping calls the correct transform', function() {
+    var Command = require('../addon/commands/convert-resource-router-mapping');
+
+    Command.run({}, []);
+    assert.deepEqual(
+      transformResourceRouterMappingCalledWith,
+      ['app/router.js']
+    );
+
+    Command.run({}, ['other-router']);
+    assert.deepEqual(
+      transformResourceRouterMappingCalledWith,
+      ['other-router']
+    );
+  });
 });