mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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
4
test/javascripts/fixtures/static_fixtures.js
Normal file
4
test/javascripts/fixtures/static_fixtures.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
3
test/javascripts/fixtures/user_fixtures.js
Normal file
3
test/javascripts/fixtures/user_fixtures.js
Normal file
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");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
22
test/javascripts/integration/static_test.js
Normal file
22
test/javascripts/integration/static_test.js
Normal 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");
|
||||
});
|
||||
});
|
||||
12
test/javascripts/integration/user_test.js
Normal file
12
test/javascripts/integration/user_test.js
Normal 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");
|
||||
});
|
||||
|
||||
});
|
||||
@@ -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