2 var TEST_MODEL
= 'test-content-model';
4 QUnit
.module( 'mediawiki.messagePoster', QUnit
.newMwEnvironment( {
5 teardown: function () {
6 mw
.messagePoster
.factory
.unregister( TEST_MODEL
);
10 QUnit
.test( 'register', 2, function ( assert
) {
11 var testMessagePosterConstructor = function () {};
13 mw
.messagePoster
.factory
.register( TEST_MODEL
, testMessagePosterConstructor
);
15 mw
.messagePoster
.factory
.contentModelToClass
[ TEST_MODEL
],
16 testMessagePosterConstructor
,
17 'Constructor is registered'
22 mw
.messagePoster
.factory
.register( TEST_MODEL
, testMessagePosterConstructor
);
24 new RegExp( 'Content model "' + TEST_MODEL
+ '" is already registered' ),
25 'Throws exception is same model is registered a second time'