Show number before trust level. Also use less memory for trust levels.

This commit is contained in:
Robin Ward
2013-07-12 16:18:32 -04:00
parent 35128c212b
commit 62d161fd70
8 changed files with 54 additions and 15 deletions

View File

@ -2,6 +2,7 @@ module("Discourse.Computed");
var testClass = Em.Object.extend({
same: Discourse.computed.propertyEqual('cookies', 'biscuits'),
diff: Discourse.computed.propertyNotEqual('cookies', 'biscuits'),
exclaimyUsername: Discourse.computed.fmt('username', "!!! %@ !!!"),
multiple: Discourse.computed.fmt('username', 'mood', "%@ is %@"),
userUrl: Discourse.computed.url('username', "/users/%@")
@ -14,11 +15,21 @@ test("propertyEqual", function() {
});
ok(t.get('same'), "it is true when the properties are the same");
t.set('biscuits', 9);
ok(!t.get('same'), "it isn't true when one property is different");
});
test("propertyNotEqual", function() {
var t = testClass.create({
cookies: 10,
biscuits: 10
});
ok(!t.get('diff'), "it isn't true when the properties are the same");
t.set('biscuits', 9);
ok(t.get('diff'), "it is true when one property is different");
});
test("fmt", function() {
var t = testClass.create({