mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
FEATURE: support uploads for themes
This allows themes to bundle various assets
This commit is contained in:
17
test/javascripts/admin/models/theme-test.js.es6
Normal file
17
test/javascripts/admin/models/theme-test.js.es6
Normal file
@ -0,0 +1,17 @@
|
||||
import Theme from 'admin/models/theme';
|
||||
|
||||
module("model:theme");
|
||||
|
||||
test('can add an upload correctly', function(assert) {
|
||||
let theme = Theme.create();
|
||||
|
||||
assert.equal(theme.get("uploads.length"), 0, "uploads should be an empty array");
|
||||
|
||||
theme.setField('common', 'bob', '', 999, 2);
|
||||
let fields = theme.get("theme_fields");
|
||||
assert.equal(fields.length, 1, 'expecting 1 theme field');
|
||||
assert.equal(fields[0].upload_id, 999, 'expecting upload id to be set');
|
||||
assert.equal(fields[0].type_id, 2, 'expecting type id to be set');
|
||||
|
||||
assert.equal(theme.get("uploads.length"), 1, "expecting an upload");
|
||||
});
|
Reference in New Issue
Block a user