TESTS: Add integration test for /top

This commit is contained in:
Robin Ward 2014-07-31 18:07:04 -04:00
parent 875ee29478
commit 77332e8b57
3 changed files with 29 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,22 @@
integration("Login Required", {
settings: {
login_required: true
}
});
test("redirect", function() {
visit('/latest');
andThen(function() {
equal(currentPath(), "login", "it redirects them to login");
});
click('#site-logo');
andThen(function() {
equal(currentPath(), "login", "clicking the logo keeps them on login");
});
click('header .login-button');
andThen(function() {
ok(exists('.login-modal'), "they can still access the login modal");
});
});

View file

@ -1,8 +1,6 @@
integration("Topic Discovery");
test("Visit Discovery Pages", function() {
expect(5);
visit("/");
andThen(function() {
ok(exists(".topic-list"), "The list of topics was rendered");
@ -19,4 +17,9 @@ test("Visit Discovery Pages", function() {
andThen(function() {
ok(exists('.category'), "has a list of categories");
});
visit("/top");
andThen(function() {
ok(exists('.topic-list .topic-list-item'), "has topics");
});
});