Skip to content

Commit

Permalink
Add test for user -> user:username
Browse files Browse the repository at this point in the history
  • Loading branch information
jarib committed Apr 10, 2015
1 parent bb44967 commit c127b24
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/unit/api/Users.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ module.exports = function (container, assert, sinon) {
config = {
api_secret: '1234'
};

options = {
stuff: 'stuff'
user: 123
};

cb = function () {
};

Expand All @@ -39,6 +41,17 @@ module.exports = function (container, assert, sinon) {
availableOptions: ['user', 'user:username']
}, options, config, cb), 'util.executeApiMethod should have been called with the correct arguments');
});

it('should handle a string user argument', function () {
users.listPosts({user: 'foo'}, cb);
assert.isTrue(executeApiMethod.calledWithExactly({
resource: 'users',
name: 'listPosts',
method: 'GET',
requiredOptions: ['api_secret'],
availableOptions: ['user', 'user:username']
}, {'user:username': 'foo'}, config, cb), 'util.executeApiMethod should have been called with the correct arguments');
});
});
};
};

0 comments on commit c127b24

Please sign in to comment.