mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
TESTS: Add integration test for /top
This commit is contained in:
parent
875ee29478
commit
77332e8b57
3 changed files with 29 additions and 2 deletions
2
test/javascripts/fixtures/top_fixture.js
Normal file
2
test/javascripts/fixtures/top_fixture.js
Normal file
File diff suppressed because one or more lines are too long
22
test/javascripts/integration/login-required-test.js.es6
Normal file
22
test/javascripts/integration/login-required-test.js.es6
Normal 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");
|
||||
});
|
||||
});
|
|
@ -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");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue