diff options
| -rw-r--r-- | lib/finance.js | 16 | ||||
| -rw-r--r-- | test/finance.unit.js | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/finance.js b/lib/finance.js index c16b9e49..c3eb0300 100644 --- a/lib/finance.js +++ b/lib/finance.js @@ -292,6 +292,22 @@ var Finance = function (faker) { prob < 40 ? Helpers.replaceSymbols("###") : ""); }; + + /** + * description + * + * @method faker.finance.transactionDescription + */ + self.transactionDescription = function() { + var account = Helpers.createTransaction().account + var card = faker.finance.mask(); + var currency = faker.finance.currencyCode(); + var amount = Helpers.createTransaction().amount + var transactionType = Helpers.createTransaction().type + var company = Helpers.createTransaction().business + return transactionType + " transaction at " + company + " using card ending with ***" + card + " for " + currency + " " + amount + " in account ***" + account + } + }; module['exports'] = Finance; diff --git a/test/finance.unit.js b/test/finance.unit.js index bad85884..a665e208 100644 --- a/test/finance.unit.js +++ b/test/finance.unit.js @@ -342,4 +342,12 @@ describe('finance.js', function () { assert.ok(bic.match(expr)); }); }); + + describe("transactionDescription()", function() { + it("returns a random transaction description", function() { + var transactionDescription = faker.finance.transactionDescription(); + + assert.ok(transactionDescription); + }) + }) }); |
