Permalink
Browse files

add tests for muteUser, unmuteUser and listMutedUsers

  • Loading branch information...
1 parent 8d84c72 commit 177f81ed40f263e7a6553d9e79de0dfaef9a62ca @damienklinnert committed Aug 17, 2012
Showing with 54 additions and 0 deletions.
  1. +54 −0 test/appdotnet.js
View
@@ -116,6 +116,60 @@ describe('AppDotNet', function () {
});
});
+ describe('object.muteUser()', function () {
+ it('returns a user object', function (done) {
+ client.muteUser(config.user_id, function (err, user) {
+ should.exist(user);
+ should.not.exist(err);
+ done();
+ });
+ });
+
+ it('returns an error when not authorized', function (done) {
+ errorClient.muteUser(config.user_id, function (err, user) {
+ should.not.exist(user);
+ should.exist(err);
+ done();
+ });
+ });
+ });
+
+ describe('object.unmuteUser()', function () {
+ it('returns a user object', function (done) {
+ client.unmuteUser(config.user_id, function (err, user) {
+ should.exist(user);
+ should.not.exist(err);
+ done();
+ });
+ });
+
+ it('returns an error when not authorized', function (done) {
+ errorClient.unmuteUser(config.user_id, function (err, user) {
+ should.not.exist(user);
+ should.exist(err);
+ done();
+ });
+ });
+ });
+
+ describe('object.listMutedUsers()', function () {
+ it('returns user objects', function (done) {
+ client.listMutedUsers(config.user_id, function (err, users) {
+ should.exist(users);
+ should.not.exist(err);
+ done();
+ });
+ });
+
+ it('returns an error when not authorized', function (done) {
+ errorClient.listMutedUsers(config.user_id, function (err, users) {
+ should.not.exist(users);
+ should.exist(err);
+ done();
+ });
+ });
+ });
+
describe('object.checkToken()', function () {
it('returns an auth object', function (done) {
client.checkToken(function (err, auth) {

0 comments on commit 177f81e

Please sign in to comment.