2015-04-06 14:14:00 -04:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
|
|
|
|
acceptance("Login Required", {
|
2014-07-31 18:07:04 -04:00
|
|
|
settings: {
|
|
|
|
login_required: true
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-06-14 13:57:58 -04:00
|
|
|
QUnit.test("redirect", assert => {
|
2014-07-31 18:07:04 -04:00
|
|
|
visit('/latest');
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2017-06-14 13:57:58 -04:00
|
|
|
assert.equal(currentPath(), "login", "it redirects them to login");
|
2014-07-31 18:07:04 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
click('#site-logo');
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2017-06-14 13:57:58 -04:00
|
|
|
assert.equal(currentPath(), "login", "clicking the logo keeps them on login");
|
2014-07-31 18:07:04 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
click('header .login-button');
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2017-06-14 13:57:58 -04:00
|
|
|
assert.ok(exists('.login-modal'), "they can still access the login modal");
|
2014-07-31 18:07:04 -04:00
|
|
|
});
|
2014-09-05 13:08:28 -04:00
|
|
|
|
2015-03-26 07:09:30 -04:00
|
|
|
click('.modal-header .close');
|
|
|
|
andThen(() => {
|
2017-06-14 13:57:58 -04:00
|
|
|
assert.ok(invisible('.login-modal'), "it closes the login modal");
|
2015-03-26 07:09:30 -04:00
|
|
|
});
|
2017-06-14 13:57:58 -04:00
|
|
|
});
|