aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFotoVerite <[email protected]>2014-02-17 12:56:00 -0500
committerFotoVerite <[email protected]>2014-02-17 12:56:00 -0500
commitc51ffc762c837ab81b3df33a45f196df29c718c7 (patch)
treeee2a6b895614e39d972f112c885f6124e08fd5e0 /test
parentcf06cdc99c2f71815d95bff8960e8f45b3a1ee38 (diff)
parentcd30841d1c0e1585eceaf1f99cfa8735c3dd170b (diff)
downloadfaker-c51ffc762c837ab81b3df33a45f196df29c718c7.tar.xz
faker-c51ffc762c837ab81b3df33a45f196df29c718c7.zip
Merge branch 'master' of github.com:passkey1510/Faker.js into passkey1510-master
Diffstat (limited to 'test')
-rw-r--r--test/image.unit.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/image.unit.js b/test/image.unit.js
new file mode 100644
index 00000000..046291ad
--- /dev/null
+++ b/test/image.unit.js
@@ -0,0 +1,38 @@
+if (typeof module !== 'undefined') {
+ var assert = require('assert');
+ var sinon = require('sinon');
+ var Faker = require('../index');
+}
+
+describe("image.js", function () {
+ describe("imageUrl()", function () {
+ it("returns a random image url from lorempixel", function () {
+ 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.LoremPixel.imageUrl(100, 100);
+
+ assert.equal(imageUrl, 'http://lorempixel.com/100/100');
+ });
+ 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.LoremPixel.nightlife();
+ assert.equal(nightlife, 'http://lorempixel.com/640/480/nightlife');
+
+ var city = Faker.Image.LoremPixel.city();
+ assert.equal(city, 'http://lorempixel.com/640/480/city');
+
+ 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'));
+ })
+ });
+});