ES6ify some of the remaining files

This commit is contained in:
Robin Ward
2015-08-07 15:08:27 -04:00
parent 378087727f
commit b7e6eaa961
96 changed files with 684 additions and 720 deletions

View File

@ -1,8 +1,10 @@
module("Discourse.Singleton");
import Singleton from 'discourse/mixins/singleton';
module("mixin:singleton");
test("current", function() {
var DummyModel = Ember.Object.extend({});
DummyModel.reopenClass(Discourse.Singleton);
DummyModel.reopenClass(Singleton);
var current = DummyModel.current();
present(current, 'current returns the current instance');
@ -12,7 +14,7 @@ test("current", function() {
test("currentProp reading", function() {
var DummyModel = Ember.Object.extend({});
DummyModel.reopenClass(Discourse.Singleton);
DummyModel.reopenClass(Singleton);
var current = DummyModel.current();
blank(DummyModel.currentProp('evil'), 'by default attributes are blank');
@ -22,7 +24,7 @@ test("currentProp reading", function() {
test("currentProp writing", function() {
var DummyModel = Ember.Object.extend({});
DummyModel.reopenClass(Discourse.Singleton);
DummyModel.reopenClass(Singleton);
blank(DummyModel.currentProp('adventure'), 'by default attributes are blank');
var result = DummyModel.currentProp('adventure', 'time');
@ -38,7 +40,7 @@ test("currentProp writing", function() {
test("createCurrent", function() {
var Shoe = Ember.Object.extend({});
Shoe.reopenClass(Discourse.Singleton, {
Shoe.reopenClass(Singleton, {
createCurrent: function() {
return Shoe.create({toes: 5});
}
@ -50,7 +52,7 @@ test("createCurrent", function() {
test("createCurrent that returns null", function() {
var Missing = Ember.Object.extend({});
Missing.reopenClass(Discourse.Singleton, {
Missing.reopenClass(Singleton, {
createCurrent: function() {
return null;
}