diff options
| author | Bryan Donovan <[email protected]> | 2013-01-07 00:03:37 -0800 |
|---|---|---|
| committer | Bryan Donovan <[email protected]> | 2013-01-07 00:03:37 -0800 |
| commit | ee9c13d35ed0dbd67e4a27ed3d525fa5926929a5 (patch) | |
| tree | c7144a15eab901e4d4332f8e5c0f1d1b5d0e0b0b /test | |
| parent | a0c614c620125efa0553aec2b470c8d8539b8ec5 (diff) | |
| download | faker-ee9c13d35ed0dbd67e4a27ed3d525fa5926929a5.tar.xz faker-ee9c13d35ed0dbd67e4a27ed3d525fa5926929a5.zip | |
brState() tests
Diffstat (limited to 'test')
| -rw-r--r-- | test/address.unit.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/address.unit.js b/test/address.unit.js index 07b5c43f..f5bbee92 100644 --- a/test/address.unit.js +++ b/test/address.unit.js @@ -157,4 +157,40 @@ describe("name.js", function () { }); }); }); + + describe("secondaryAddress()", function() { + // TODO + }); + + describe("brState()", function() { + beforeEach(function () { + sinon.spy(random, 'br_state_abbr'); + sinon.spy(random, 'br_state'); + }); + + afterEach(function () { + random.br_state_abbr.restore(); + random.br_state.restore(); + }); + + context("when useAbbr is true", function () { + it("returns a br_state_abbr", function () { + var state = Faker.Address.brState(true); + + assert.ok(state); + assert.ok(random.br_state_abbr.called); + assert.ok(!random.br_state.called); + }); + }); + + context("when useAbbr is not set", function () { + it("returns a br_state", function () { + var state = Faker.Address.brState(); + + assert.ok(state); + assert.ok(!random.br_state_abbr.called); + assert.ok(random.br_state.called); + }); + }); + }); }); |
