2015-04-16 13:53:30 -04:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
acceptance("Topic - Anonymous");
|
|
|
|
|
|
|
|
test("Enter a Topic", () => {
|
|
|
|
visit("/t/internationalization-localization/280/1");
|
|
|
|
andThen(() => {
|
|
|
|
ok(exists("#topic"), "The topic was rendered");
|
|
|
|
ok(exists("#topic .cooked"), "The topic has cooked posts");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
test("Enter without an id", () => {
|
|
|
|
visit("/t/internationalization-localization");
|
|
|
|
andThen(() => {
|
|
|
|
ok(exists("#topic"), "The topic was rendered");
|
|
|
|
});
|
|
|
|
});
|
2015-05-27 13:53:49 -04:00
|
|
|
|
2015-08-25 04:42:19 -04:00
|
|
|
test("Enter a 404 topic", assert => {
|
2015-06-10 13:12:15 -04:00
|
|
|
visit("/t/not-found/404");
|
|
|
|
andThen(() => {
|
|
|
|
assert.ok(!exists("#topic"), "The topic was not rendered");
|
|
|
|
assert.ok(find(".not-found").text() === "not found", "it renders the error message");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2015-08-25 04:42:19 -04:00
|
|
|
test("Enter without access", assert => {
|
2015-05-27 13:53:49 -04:00
|
|
|
visit("/t/i-dont-have-access/403");
|
|
|
|
andThen(() => {
|
|
|
|
assert.ok(!exists("#topic"), "The topic was not rendered");
|
|
|
|
assert.ok(exists(".topic-error"), "An error message is displayed");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2015-08-25 04:42:19 -04:00
|
|
|
test("Enter with 500 errors", assert => {
|
2015-05-27 13:53:49 -04:00
|
|
|
visit("/t/throws-error/500");
|
|
|
|
andThen(() => {
|
|
|
|
assert.ok(!exists("#topic"), "The topic was not rendered");
|
|
|
|
assert.ok(exists(".topic-error"), "An error message is displayed");
|
|
|
|
});
|
|
|
|
});
|