FIX: Rather than using singleton: false for avoiding caching in the

container, just unregister it afterwards.
This commit is contained in:
Robin Ward 2014-04-15 13:03:20 -04:00
parent c9c95a9ac2
commit 617b4bed41

View File

@ -1,15 +1,18 @@
var originalTemplates, originalMobileViewFlag;
var lookup = function(lookupString, expectedTemplate, message) {
// {singleton: false} prevents Ember from caching lookup results (what would make them persistent across multiple tests, breaking test isolation)
equal(Discourse.__container__.lookup(lookupString, {singleton: false}), expectedTemplate, message);
};
function lookup(lookupString, expectedTemplate, message) {
var container = Discourse.__container__;
equal(container.lookup(lookupString), expectedTemplate, message);
var setTemplates = function(lookupStrings) {
// Remove any cached results from the container
container.unregister(lookupString);
}
function setTemplates(lookupStrings) {
lookupStrings.forEach(function(lookupString) {
Ember.TEMPLATES[lookupString] = lookupString;
});
};
}
module("Discourse.Resolver", {
setup: function() {