More Javascript Tests + Fixtures. Also a rake task to crawl them.

This commit is contained in:
Robin Ward
2013-07-04 16:19:59 -04:00
parent 594cb50f18
commit 4a3bc1fb43
12 changed files with 110 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
function integration(name) {
module(name, {
module("Integration: " + name, {
setup: function() {
sinon.stub(Discourse.ScrollingDOMMethods, "bindOnScroll");
sinon.stub(Discourse.ScrollingDOMMethods, "unbindOnScroll");

View File

@@ -1,24 +1,29 @@
integration("List Topics");
test("Default List", function() {
expect(2);
visit("/").then(function() {
expect(2);
ok(exists("#topic-list"), "The list of topics was rendered");
ok(exists('#topic-list .topic-list-item'), "has topics");
});
});
test("List one Category", function() {
expect(2);
visit("/category/bug").then(function() {
ok(exists("#topic-list"), "The list of topics was rendered");
ok(exists('#topic-list .topic-list-item'), "has topics");
});
});
test("Categories List", function() {
expect(1);
visit("/categories").then(function() {
expect(1);
ok(exists('.category-list-item'), "has a list of categories");
});
});

View File

@@ -0,0 +1,22 @@
integration("Static");
test("Faq", function() {
expect(1);
visit("/faq").then(function() {
ok(exists(".body-page"), "The content is present");
});
});
test("Terms of Service", function() {
expect(1);
visit("/tos").then(function() {
ok(exists(".body-page"), "The content is present");
});
});
test("Privacy", function() {
expect(1);
visit("/privacy").then(function() {
ok(exists(".body-page"), "The content is present");
});
});

View File

@@ -0,0 +1,12 @@
integration("User");
test("Profile", function() {
visit("/users/eviltrout").then(function() {
expect(2);
ok(exists(".user-heading"), "The heading is rendered");
ok(exists("#user-stream"), "The stream is rendered");
});
});

View File

@@ -1,6 +1,6 @@
integration("View Topic");
test("View a Topic", function() {
test("Enter a Topic", function() {
visit("/t/internationalization-localization/280").then(function() {
expect(2);