From 359145218477f45e18436fc780ef7b2143a1d92e Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 26 Sep 2016 00:20:47 -0700 Subject: [PATCH] test that invalid alias cannot be set --- src/test/user-test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/user-test.js b/src/test/user-test.js index 2eaa116df..775fdc291 100644 --- a/src/test/user-test.js +++ b/src/test/user-test.js @@ -744,6 +744,13 @@ describe('User', function () { before(createOwner); after(cleanupUsers); + it('cannot set invalid alias', function (done) { + user.setAliases(userObject.id, [ 'a$scii' ], function (error) { + expect(error.reason).to.be(UserError.BAD_FIELD); + done(); + }); + }); + it('can set aliases', function (done) { user.setAliases(userObject.id, [ 'everything', 'is', 'awesome' ], function (error) { expect(error).to.be(null);