Ember RC6 update

This commit is contained in:
Robin Ward
2013-07-15 19:47:13 -04:00
parent 75282576b9
commit d466d11e71
23 changed files with 5850 additions and 2002 deletions
+10 -7
View File
@@ -4,17 +4,20 @@ module("Discourse.Onebox", {
}
});
test("Stops rapid calls with cache true", function() {
this.stub(Discourse, "ajax").returns(resolvingPromise);
asyncTestDiscourse("Stops rapid calls with cache true", function() {
this.stub(Discourse, "ajax").returns(Ember.RSVP.resolve());
Discourse.Onebox.load(this.anchor, true);
Discourse.Onebox.load(this.anchor, true);
Discourse.Onebox.load(this.anchor, true);
Discourse.Onebox.load(this.anchor, true);
start();
ok(Discourse.ajax.calledOnce);
});
test("Stops rapid calls with cache false", function() {
this.stub(Discourse, "ajax").returns(resolvingPromise);
asyncTestDiscourse("Stops rapid calls with cache true", function() {
this.stub(Discourse, "ajax").returns(Ember.RSVP.resolve());
Discourse.Onebox.load(this.anchor, false);
Discourse.Onebox.load(this.anchor, false);
start();
ok(Discourse.ajax.calledOnce);
});
});
@@ -14,7 +14,7 @@ test("remove", function() {
blank(PreloadStore.get('bane'), "removes the value if the key exists");
});
asyncTest("getAndRemove returns a promise that resolves to null", function() {
asyncTestDiscourse("getAndRemove returns a promise that resolves to null", function() {
expect(1);
PreloadStore.getAndRemove('joker').then(function(result) {
@@ -23,7 +23,7 @@ asyncTest("getAndRemove returns a promise that resolves to null", function() {
});
});
asyncTest("getAndRemove returns a promise that resolves to the result of the finder", function() {
asyncTestDiscourse("getAndRemove returns a promise that resolves to the result of the finder", function() {
expect(1);
var finder = function() { return 'batdance'; };
@@ -34,7 +34,7 @@ asyncTest("getAndRemove returns a promise that resolves to the result of the fin
});
asyncTest("getAndRemove returns a promise that resolves to the result of the finder's promise", function() {
asyncTestDiscourse("getAndRemove returns a promise that resolves to the result of the finder's promise", function() {
expect(1);
var finder = function() {
@@ -47,7 +47,7 @@ asyncTest("getAndRemove returns a promise that resolves to the result of the fin
});
});
asyncTest("returns a promise that rejects with the result of the finder's rejected promise", function() {
asyncTestDiscourse("returns a promise that rejects with the result of the finder's rejected promise", function() {
expect(1);
var finder = function() {
@@ -61,7 +61,7 @@ asyncTest("returns a promise that rejects with the result of the finder's reject
});
asyncTest("returns a promise that resolves to 'evil'", function() {
asyncTestDiscourse("returns a promise that resolves to 'evil'", function() {
expect(1);
PreloadStore.getAndRemove('bane').then(function(result) {