mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FEATURE: Show user fields when the user is signing up
This commit is contained in:
parent
872d8fce58
commit
edb34c178a
42 changed files with 476 additions and 141 deletions
62
test/javascripts/helpers/qunit-helpers.js.es6
Normal file
62
test/javascripts/helpers/qunit-helpers.js.es6
Normal file
|
@ -0,0 +1,62 @@
|
|||
/* global asyncTest */
|
||||
|
||||
import siteFixtures from 'fixtures/site_fixtures';
|
||||
|
||||
export function integration(name, options) {
|
||||
module("Integration: " + name, {
|
||||
setup: function() {
|
||||
Ember.run(Discourse, Discourse.advanceReadiness);
|
||||
|
||||
var siteJson = siteFixtures['site.json'].site;
|
||||
if (options) {
|
||||
if (options.setup) {
|
||||
options.setup.call(this);
|
||||
}
|
||||
|
||||
if (options.user) {
|
||||
Discourse.User.resetCurrent(Discourse.User.create(options.user));
|
||||
}
|
||||
|
||||
if (options.settings) {
|
||||
Discourse.SiteSettings = jQuery.extend(true, Discourse.SiteSettings, options.settings);
|
||||
}
|
||||
|
||||
if (options.site) {
|
||||
Discourse.Site.resetCurrent(Discourse.Site.create(jQuery.extend(true, {}, siteJson, options.site)));
|
||||
}
|
||||
}
|
||||
|
||||
Discourse.reset();
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if (options && options.teardown) {
|
||||
options.teardown.call(this);
|
||||
}
|
||||
|
||||
Discourse.reset();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function controllerFor(controller, model) {
|
||||
controller = Discourse.__container__.lookup('controller:' + controller);
|
||||
if (model) { controller.set('model', model ); }
|
||||
return controller;
|
||||
}
|
||||
|
||||
export function asyncTestDiscourse(text, func) {
|
||||
asyncTest(text, function () {
|
||||
var self = this;
|
||||
Ember.run(function () {
|
||||
func.call(self);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function fixture(selector) {
|
||||
if (selector) {
|
||||
return $("#qunit-fixture").find(selector);
|
||||
}
|
||||
return $("#qunit-fixture");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue