Add an integration test for the new Ember 404 route

This commit is contained in:
Robin Ward 2014-04-29 15:29:01 -04:00
parent f50039b48b
commit 0528b408a3
3 changed files with 12 additions and 1 deletions

View File

@ -14,7 +14,8 @@ task 'integration:create_fixtures' => :environment do
"/user_actions.json?offset=0&username=eviltrout&filter=1",
"/user_actions.json?offset=0&username=eviltrout&filter=2",
"/user_actions.json?offset=0&username=eviltrout&filter=11"],
static: ["/faq", '/tos', '/privacy']
static: ["/faq", '/tos', '/privacy'],
unknown: ['/404-body']
}
fixtures.each do |type, urls|

View File

@ -0,0 +1,2 @@
/*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";

View File

@ -0,0 +1,8 @@
integration("Unknown");
test("Unknown URL", function() {
expect(1);
visit("/url-that-doesn't-exist").then(function() {
ok(exists(".page-not-found"), "The not found content is present");
});
});