Previously, `resetSite()` would immediately generate a new `Site` instance, and run all the initialization logic within the model. This included initializing Category objects. This was problematic because `resetSite()` is called before any initializers have been run. That means that any modifications to the Site or Category classes would not have any effect on the already-initialized Site/Category instances. This commit makes two main changes so so that the test environment is more production-like: 1. Update `resetSite` so that it simply stores the new data in the PreloadStore, and destroys the old Site instance. Initialization of a new site instance happens 'just in time' (normally during the `inject-discourse-objects` initializer) 2. Update the `helperContext` in tests to use getters. This avoids the need to look up `Site.current()` before initializers have run It also makes a minor adjustment to one test which was relying on a side-effect of the previous behavior. This should resolve the failing tests for discourse-category-expert under Ember-CLI: https://github.com/discourse/discourse-category-experts/pull/69 |
||
|---|---|---|
| .. | ||
| acceptance | ||
| fixtures | ||
| helpers | ||
| integration | ||
| unit | ||
| active-plugins.js.erb | ||
| core-tests.js | ||
| index.html | ||
| plugin-tests.js.erb | ||
| setup-tests.js | ||
| test_starter.js | ||
| test-boot-ember-cli.js | ||
| test-helpers-rails.js | ||
| test-support-rails.js | ||
| theme_qunit_ember_jquery.js | ||