diff options
| author | Kieu Anh Tuan <[email protected]> | 2014-01-08 12:19:14 +0100 |
|---|---|---|
| committer | Kieu Anh Tuan <[email protected]> | 2014-01-08 12:19:14 +0100 |
| commit | cd30841d1c0e1585eceaf1f99cfa8735c3dd170b (patch) | |
| tree | fe50d9f58416d548e84034ce75ef0b1a98b5b67b /test | |
| parent | 41688effa91319121a7fe8a981c4a7ebb986339b (diff) | |
| download | faker-cd30841d1c0e1585eceaf1f99cfa8735c3dd170b.tar.xz faker-cd30841d1c0e1585eceaf1f99cfa8735c3dd170b.zip | |
Add UIFaces to generate random avatar
Diffstat (limited to 'test')
| -rw-r--r-- | test/image.unit.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/image.unit.js b/test/image.unit.js index 005f15f7..046291ad 100644 --- a/test/image.unit.js +++ b/test/image.unit.js @@ -7,29 +7,32 @@ if (typeof module !== 'undefined') { describe("image.js", function () { describe("imageUrl()", function () { it("returns a random image url from lorempixel", function () { - var imageUrl = Faker.Image.imageUrl(); + var imageUrl = Faker.Image.LoremPixel.imageUrl(); assert.equal(imageUrl, 'http://lorempixel.com/640/480'); }); it("returns a random image url from lorempixel with width and height", function () { - var imageUrl = Faker.Image.imageUrl(100, 100); + var imageUrl = Faker.Image.LoremPixel.imageUrl(100, 100); assert.equal(imageUrl, 'http://lorempixel.com/100/100'); }); - it("returns a random image url in a abstract category", function () { - var imageUrl = Faker.Image.imageUrl(100, 100, 'abstract'); + it("returns a random image url in an abstract category", function () { + var imageUrl = Faker.Image.LoremPixel.imageUrl(100, 100, 'abstract'); assert.equal(imageUrl, 'http://lorempixel.com/100/100/abstract'); }); it("returns a random image url in a category via proxy methods", function () { - var nightlife = Faker.Image.nightlife(); + var nightlife = Faker.Image.LoremPixel.nightlife(); assert.equal(nightlife, 'http://lorempixel.com/640/480/nightlife'); - var city = Faker.Image.city(); + var city = Faker.Image.LoremPixel.city(); assert.equal(city, 'http://lorempixel.com/640/480/city'); - var fashion = Faker.Image.fashion(); + var fashion = Faker.Image.LoremPixel.fashion(); assert.equal(fashion, 'http://lorempixel.com/640/480/fashion'); }); + it("return a random avatar from UIFaces", function () { + assert.notEqual(-1, Faker.Image.UIFaces.avatar().indexOf('s3.amazonaws.com/uifaces/faces')); + }) }); }); |
