mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
19 lines
No EOL
577 B
JavaScript
19 lines
No EOL
577 B
JavaScript
module("Discourse.User");
|
|
|
|
test('staff', function(){
|
|
var user = Discourse.User.create({id: 1, username: 'eviltrout'});
|
|
|
|
ok(!user.get('staff'), "user is not staff");
|
|
|
|
user.toggleProperty('moderator');
|
|
ok(user.get('staff'), "moderators are staff");
|
|
|
|
user.setProperties({moderator: false, admin: true});
|
|
ok(user.get('staff'), "admins are staff");
|
|
});
|
|
|
|
test('searchContext', function() {
|
|
var user = Discourse.User.create({id: 1, username: 'EvilTrout'});
|
|
|
|
deepEqual(user.get('searchContext'), {type: 'user', id: 'eviltrout', user: user}, "has a search context");
|
|
}); |