mirror of
https://github.com/discourse/discourse.git
synced 2025-06-19 05:37:59 +08:00
Revert "REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS"
This reverts commit c0b277d273536f6aab1df67d908ed5e306868b2a.
This commit is contained in:
@ -1,10 +1,9 @@
|
||||
import { present } from 'helpers/qunit-helpers';
|
||||
import ApiKey from 'admin/models/api-key';
|
||||
|
||||
module("Discourse.ApiKey");
|
||||
|
||||
test('create', function() {
|
||||
var apiKey = ApiKey.create({id: 123, user: {id: 345}});
|
||||
var apiKey = Discourse.ApiKey.create({id: 123, user: {id: 345}});
|
||||
|
||||
present(apiKey, 'it creates the api key');
|
||||
present(apiKey.get('user'), 'it creates the user inside');
|
||||
@ -13,7 +12,7 @@ test('create', function() {
|
||||
|
||||
asyncTestDiscourse('find', function() {
|
||||
sandbox.stub(Discourse, 'ajax').returns(Ember.RSVP.resolve([]));
|
||||
ApiKey.find().then(function() {
|
||||
Discourse.ApiKey.find().then(function() {
|
||||
start();
|
||||
ok(Discourse.ajax.calledWith("/admin/api"), "it GETs the keys");
|
||||
});
|
||||
@ -21,14 +20,14 @@ asyncTestDiscourse('find', function() {
|
||||
|
||||
asyncTestDiscourse('generateMasterKey', function() {
|
||||
sandbox.stub(Discourse, 'ajax').returns(Ember.RSVP.resolve({api_key: {}}));
|
||||
ApiKey.generateMasterKey().then(function() {
|
||||
Discourse.ApiKey.generateMasterKey().then(function() {
|
||||
start();
|
||||
ok(Discourse.ajax.calledWith("/admin/api/key", {type: 'POST'}), "it POSTs to create a master key");
|
||||
});
|
||||
});
|
||||
|
||||
asyncTestDiscourse('regenerate', function() {
|
||||
var apiKey = ApiKey.create({id: 3456});
|
||||
var apiKey = Discourse.ApiKey.create({id: 3456});
|
||||
|
||||
sandbox.stub(Discourse, 'ajax').returns(Ember.RSVP.resolve({api_key: {id: 3456}}));
|
||||
apiKey.regenerate().then(function() {
|
||||
@ -38,7 +37,7 @@ asyncTestDiscourse('regenerate', function() {
|
||||
});
|
||||
|
||||
asyncTestDiscourse('revoke', function() {
|
||||
var apiKey = ApiKey.create({id: 3456});
|
||||
var apiKey = Discourse.ApiKey.create({id: 3456});
|
||||
|
||||
sandbox.stub(Discourse, 'ajax').returns(Ember.RSVP.resolve([]));
|
||||
apiKey.revoke().then(function() {
|
||||
|
Reference in New Issue
Block a user