This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
discourse/test/javascripts/components/onebox_test.js

24 lines
656 B
JavaScript
Raw Normal View History

module("Discourse.Onebox", {
setup: function() {
this.anchor = $("<a href='http://bla.com'></a>")[0];
}
});
2013-07-15 19:47:13 -04:00
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);
2013-07-15 19:47:13 -04:00
start();
ok(Discourse.ajax.calledOnce);
});
2013-07-15 19:47:13 -04:00
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);
2013-07-15 19:47:13 -04:00
start();
ok(Discourse.ajax.calledOnce);
2013-07-15 19:47:13 -04:00
});