More Javascript Tests + Fixtures. Also a rake task to crawl them.
This commit is contained in:
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
@@ -1,5 +1,5 @@
|
||||
function integration(name) {
|
||||
module(name, {
|
||||
module("Integration: " + name, {
|
||||
setup: function() {
|
||||
sinon.stub(Discourse.ScrollingDOMMethods, "bindOnScroll");
|
||||
sinon.stub(Discourse.ScrollingDOMMethods, "unbindOnScroll");
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
});
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
});
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user