mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
23 lines
656 B
JavaScript
23 lines
656 B
JavaScript
module("Discourse.Onebox", {
|
|
setup: function() {
|
|
this.anchor = $("<a href='http://bla.com'></a>")[0];
|
|
}
|
|
});
|
|
|
|
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);
|
|
|
|
start();
|
|
ok(Discourse.ajax.calledOnce);
|
|
});
|
|
|
|
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);
|
|
});
|