mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:01:14 +08:00
REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS
This change is discussed here: https://meta.discourse.org/t/deprecating-es6-compatibility-layer/35821 Prior to this change we were not booting correctly with DISCOURSE_NO_CONSTANTS
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
import { blank, present } from 'helpers/qunit-helpers';
|
||||
import AdminUser from 'admin/models/admin-user';
|
||||
import ApiKey from 'admin/models/api-key';
|
||||
|
||||
module("Discourse.AdminUser");
|
||||
|
||||
asyncTestDiscourse('generate key', function() {
|
||||
sandbox.stub(Discourse, 'ajax').returns(Ember.RSVP.resolve({api_key: {id: 1234, key: 'asdfasdf'}}));
|
||||
|
||||
var adminUser = Discourse.AdminUser.create({id: 333});
|
||||
var adminUser = AdminUser.create({id: 333});
|
||||
|
||||
blank(adminUser.get('api_key'), 'it has no api key by default');
|
||||
adminUser.generateApiKey().then(function() {
|
||||
@ -17,8 +19,8 @@ asyncTestDiscourse('generate key', function() {
|
||||
|
||||
asyncTestDiscourse('revoke key', function() {
|
||||
|
||||
var apiKey = Discourse.ApiKey.create({id: 1234, key: 'asdfasdf'}),
|
||||
adminUser = Discourse.AdminUser.create({id: 333, api_key: apiKey});
|
||||
var apiKey = ApiKey.create({id: 1234, key: 'asdfasdf'}),
|
||||
adminUser = AdminUser.create({id: 333, api_key: apiKey});
|
||||
|
||||
sandbox.stub(Discourse, 'ajax').returns(Ember.RSVP.resolve());
|
||||
|
||||
|
Reference in New Issue
Block a user