mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 16:46:12 +08:00
FIX: Rather than using singleton: false
for avoiding caching in the
container, just unregister it afterwards.
This commit is contained in:
parent
c9c95a9ac2
commit
617b4bed41
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user