mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
TESTS: Remove URL_FIXTURES constant for pretender
This commit is contained in:
File diff suppressed because one or more lines are too long
6
test/javascripts/fixtures/badges_fixture.js.es6
Normal file
6
test/javascripts/fixtures/badges_fixture.js.es6
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
6
test/javascripts/fixtures/discovery_fixtures.js.es6
Normal file
6
test/javascripts/fixtures/discovery_fixtures.js.es6
Normal file
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
/*jshint maxlen:10000000 */
|
||||
Discourse.URL_FIXTURES["/draft.json"] = {};
|
||||
@@ -1,2 +0,0 @@
|
||||
/*jshint maxlen:10000000 */
|
||||
Discourse.URL_FIXTURES["/notifications"] = [ { notification_type: 2, read: true, post_number: 2, topic_id: 1234, slug: "a-slug", data: { topic_title: "some title", display_username: "velesin" } } ];
|
||||
2
test/javascripts/fixtures/notification_fixtures.js.es6
Normal file
2
test/javascripts/fixtures/notification_fixtures.js.es6
Normal file
@@ -0,0 +1,2 @@
|
||||
/*jshint maxlen:10000000 */
|
||||
export default {"/notifications": [ { notification_type: 2, read: true, post_number: 2, topic_id: 1234, slug: "a-slug", data: { topic_title: "some title", display_username: "velesin" } } ] };
|
||||
@@ -1,2 +0,0 @@
|
||||
/*jshint maxlen:10000000 */
|
||||
Discourse.URL_FIXTURES["/search"] = [ { type: "topic", more: true, results: [ { url: "some-url" } ] } ];
|
||||
File diff suppressed because one or more lines are too long
5
test/javascripts/fixtures/static_fixtures.js.es6
Normal file
5
test/javascripts/fixtures/static_fixtures.js.es6
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
test/javascripts/fixtures/top_fixture.js.es6
Normal file
2
test/javascripts/fixtures/top_fixture.js.es6
Normal file
File diff suppressed because one or more lines are too long
2
test/javascripts/fixtures/topic.js.es6
Normal file
2
test/javascripts/fixtures/topic.js.es6
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
/*jshint maxlen:10000000 */
|
||||
Discourse.URL_FIXTURES["/404-body"] = "\n\u003Ch1 class=\"page-not-found\"\u003EThe page you requested doesn\u0026#39;t exist or is private.\u003C/h1\u003E\n\n\u003Cdiv class=\"row\"\u003E\n \u003Cdiv class=\"span8\"\u003E\n \u003Ch2 class=\"popular-topics-title\"\u003EPopular topics\u003C/h2\u003E\n \u003Ca href=\"/t/is-it-better-for-discourse-to-use-javascript-or-coffeescript/3153\"\u003EIs it better for Discourse to use JavaScript or CoffeeScript?\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/tuning-ruby-and-rails-for-discourse/4126\"\u003ETuning Ruby and Rails for Discourse\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/welcome-to-meta-discourse-org/1\"\u003EWelcome to meta.discourse.org\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/what-is-wrong-with-phpbb/3763\"\u003EWhat is wrong with PHPBB?\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/what-is-a-onebox/4546\"\u003EWhat is a onebox?\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/so-you-want-to-help-out-with-discourse/3823\"\u003ESo, you want to help out with Discourse\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/please-visit-our-discourse-forum-directory/3102\"\u003EPlease visit our Discourse Forum! (Directory)\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/why-is-discourse-so-slow-on-android/8823\"\u003EWhy is Discourse so slow on Android?\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/what-i-love-about-wordpress-plugins/5697\"\u003EWhat I love about WordPress plugins\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/anyone-got-this-running-on-heroku-yet/625\"\u003EAnyone got this running on Heroku yet?\u003C/a\u003E\u003Cbr/\u003E\n \u003Cbr/\u003E\n \u003Ca href=\"/latest\" class=\"btn\"\u003ESee More\u0026hellip;\u003C/a\u003E\n \u003C/div\u003E\n \u003Cdiv class=\"span8\"\u003E\n \u003Ch2 class=\"recent-topics-title\"\u003ERecent topics\u003C/h2\u003E\n \u003Ca href=\"/t/making-external-api-call-after-logging-in/15160\"\u003EMaking external API call after logging in\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/upload-maximum-value/15159\"\u003EUpload maximum value\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/people-with-experience-bitnami-vs-discoursehosting-com-s/15156\"\u003EPeople with experience, Bitnami vs DiscourseHosting.com? :S\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/support-docker-v0-9-1-and-up/15154\"\u003ESupport Docker v0.9.1 and up\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/how-to-rearrange-participants-list/15152\"\u003EHow to rearrange participants list?\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/how-to-use-category-color-as-background-color/15151\"\u003EHow to use category color as background color?\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/roadmap-for-styling-email-digest/15150\"\u003ERoadmap for styling email digest\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/undefined-on-latest-link/15148\"\u003EUndefined on latest link\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/performance-through-the-roof-since-docker-izing/15147\"\u003EPerformance through the roof since docker-izing\u003C/a\u003E\u003Cbr/\u003E\n \u003Ca href=\"/t/a-image-slider-possible/15139\"\u003EA Image Slider? Possible?\u003C/a\u003E\u003Cbr/\u003E\n \u003Cbr/\u003E\n \u003Ca href=\"/latest\" class=\"btn\"\u003ESee More\u0026hellip;\u003C/a\u003E\n \u003C/div\u003E\n\u003C/div\u003E\n\n";
|
||||
File diff suppressed because one or more lines are too long
6
test/javascripts/fixtures/user_fixtures.js.es6
Normal file
6
test/javascripts/fixtures/user_fixtures.js.es6
Normal file
File diff suppressed because one or more lines are too long
@@ -17,6 +17,35 @@ function response(code, obj) {
|
||||
|
||||
export default function() {
|
||||
var server = new Pretender(function() {
|
||||
|
||||
// Load any fixtures automatically
|
||||
var self = this;
|
||||
Ember.keys(require._eak_seen).forEach(function(entry) {
|
||||
if (/^fixtures/.test(entry)) {
|
||||
var fixture = require(entry, null, null, true);
|
||||
if (fixture && fixture.default) {
|
||||
var obj = fixture.default;
|
||||
Ember.keys(obj).forEach(function(url) {
|
||||
self.get(url, function() {
|
||||
return response(obj[url]);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.get("/404-body", function() {
|
||||
return [200, {"Content-Type": "text/html"}, "<div class='page-not-found'>not found</div>"];
|
||||
});
|
||||
|
||||
this.get("/search", function() {
|
||||
return response([ { type: "topic", more: true, results: [ { url: "some-url" } ] } ]);
|
||||
});
|
||||
|
||||
this.get('/draft.json', function() {
|
||||
return response({});
|
||||
});
|
||||
|
||||
this.post('/session', function(request) {
|
||||
var data = parsePostData(request.requestBody);
|
||||
|
||||
@@ -55,6 +84,7 @@ export default function() {
|
||||
if (body && typeof body === "object") {
|
||||
return JSON.stringify(body);
|
||||
}
|
||||
return body;
|
||||
};
|
||||
|
||||
server.unhandledRequest = function(verb, path) {
|
||||
|
||||
Reference in New Issue
Block a user