diff options
| author | Marak <[email protected]> | 2015-07-08 21:18:48 -0700 |
|---|---|---|
| committer | Marak <[email protected]> | 2015-07-08 21:18:48 -0700 |
| commit | edb7d482a40e98ce25cd6ba296818be14f291aa1 (patch) | |
| tree | 5a5c2e154fcdc2410bd279ac4df319bc2b144c93 | |
| parent | d44c5a4b355c2b29b860bd8edf123b73ddd2c3a4 (diff) | |
| download | faker-edb7d482a40e98ce25cd6ba296818be14f291aa1.tar.xz faker-edb7d482a40e98ce25cd6ba296818be14f291aa1.zip | |
[fix] Comment out a few methods sections of commerce section. Needs some work. #183
| -rw-r--r-- | Readme.md | 2 | ||||
| -rw-r--r-- | lib/commerce.js | 8 | ||||
| -rw-r--r-- | test/commerce.unit.js | 8 |
3 files changed, 13 insertions, 5 deletions
@@ -68,8 +68,6 @@ This will interpolate the format string with the value of methods `name.lastName * department * productName * price - * categories - * mergeCategories * productAdjective * productMaterial * product diff --git a/lib/commerce.js b/lib/commerce.js index 755bf828..276f1698 100644 --- a/lib/commerce.js +++ b/lib/commerce.js @@ -6,6 +6,9 @@ var Commerce = function (faker) { }; self.department = function(max, fixedAmount) { + + return faker.random.array_element(faker.definitions.commerce.department); + /* max = max || 3; var num = Math.floor((Math.random() * max) + 1); @@ -20,6 +23,7 @@ var Commerce = function (faker) { } return categories[0]; + */ }; self.productName = function() { @@ -41,6 +45,7 @@ var Commerce = function (faker) { return symbol + (Math.round((Math.random() * (max - min) + min) * Math.pow(10, dec)) / Math.pow(10, dec)).toFixed(dec); }; + /* self.categories = function(num) { var categories = []; @@ -54,6 +59,8 @@ var Commerce = function (faker) { return categories; }; + */ + /* self.mergeCategories = function(categories) { var separator = faker.definitions.separator || " &"; // TODO: find undefined here @@ -62,6 +69,7 @@ var Commerce = function (faker) { return [commaSeparated, categories[categories.length - 1]].join(separator + " "); }; + */ self.productAdjective = function() { return faker.random.array_element(faker.definitions.commerce.product_name.adjective); diff --git a/test/commerce.unit.js b/test/commerce.unit.js index 7abcf888..759c3962 100644 --- a/test/commerce.unit.js +++ b/test/commerce.unit.js @@ -17,10 +17,11 @@ describe("commerce.js", function() { it("should use the default amounts when not passing arguments", function() { var department = faker.commerce.department(); - - assert.ok(department.split(" ").length <= 4); + assert.ok(department.split(" ").length === 1); }); + /* + it("should return only one value if we specify a maximum of one", function() { sinon.spy(faker.random, 'array_element'); @@ -46,7 +47,8 @@ describe("commerce.js", function() { assert.ok(faker.random.array_element.callCount >= 5); faker.random.array_element.restore(); - }) + }); + */ }); describe("productName()", function() { |
