2017-05-05 01:34:47 -05:00
|
|
|
import Group from 'discourse/models/group';
|
|
|
|
|
2017-06-14 12:57:58 -05:00
|
|
|
QUnit.module("model:group");
|
2017-05-05 01:34:47 -05:00
|
|
|
|
2017-06-14 12:57:58 -05:00
|
|
|
QUnit.test('displayName', assert => {
|
2017-05-05 01:34:47 -05:00
|
|
|
const group = Group.create({ name: "test", display_name: 'donkey' });
|
|
|
|
|
2017-07-27 03:05:08 -05:00
|
|
|
assert.equal(group.get('displayName'), "donkey", 'it should return the display name');
|
2017-05-05 01:34:47 -05:00
|
|
|
|
|
|
|
group.set('display_name', null);
|
|
|
|
|
2017-07-27 03:05:08 -05:00
|
|
|
assert.equal(group.get('displayName'), "test", "it should return the group's name");
|
|
|
|
});
|