mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Add tests for our store
This commit is contained in:
19
test/javascripts/helpers/create-store.js.es6
Normal file
19
test/javascripts/helpers/create-store.js.es6
Normal file
@ -0,0 +1,19 @@
|
||||
import Store from "discourse/models/store";
|
||||
import RestAdapter from 'discourse/adapters/rest';
|
||||
|
||||
let _restAdapter;
|
||||
export default function() {
|
||||
return Store.create({
|
||||
container: {
|
||||
lookup(type) {
|
||||
if (type === "adapter:rest") {
|
||||
_restAdapter = _restAdapter || RestAdapter.create({ container: this });
|
||||
return (_restAdapter);
|
||||
}
|
||||
},
|
||||
|
||||
lookupFactory: function() { }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user