mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 15:42:46 +08:00
![Robin Ward](/assets/img/avatar_default.png)
* REFACTOR: Get us closer to no `Discourse` constants in tests * REFACTOR: Remove `Discourse.currentUser` * REFACTOR: `prioritizeNameInUx` is really a helper and can use context * REFACTOR: Rename test * REFACTOR: Remove `Discourse.MarkdownItURL` and use session * REFACTOR: Remove unused `LetterAvatarVersion` * REFACTOR: Remove unused `Discourse.ThemeSettings` * REFACTOR: Remove unused CDN constants * REFACTOR: The `globalNotice` property doesn't exist anymore * REFACTOR: Remove `Discourse.__container__` from plugin api * REFACTOR: Consider `logout()` a helper and remove container.
35 lines
926 B
JavaScript
35 lines
926 B
JavaScript
import EmailLog from "admin/models/email-log";
|
|
import { setPrefix } from "discourse-common/lib/get-url";
|
|
|
|
QUnit.module("model:email-log");
|
|
|
|
QUnit.test("create", assert => {
|
|
assert.ok(EmailLog.create(), "it can be created without arguments");
|
|
});
|
|
|
|
QUnit.test("subfolder support", assert => {
|
|
setPrefix("/forum");
|
|
const attrs = {
|
|
id: 60,
|
|
to_address: "wikiman@asdf.com",
|
|
email_type: "user_linked",
|
|
user_id: 9,
|
|
created_at: "2018-08-08T17:21:52.022Z",
|
|
post_url: "/t/some-pro-tips-for-you/41/5",
|
|
post_description: "Some Pro Tips For You",
|
|
bounced: false,
|
|
user: {
|
|
id: 9,
|
|
username: "wikiman",
|
|
avatar_template:
|
|
"/forum/letter_avatar_proxy/v2/letter/w/dfb087/{size}.png"
|
|
}
|
|
};
|
|
const emailLog = EmailLog.create(attrs);
|
|
assert.equal(
|
|
emailLog.get("post_url"),
|
|
"/forum/t/some-pro-tips-for-you/41/5",
|
|
"includes the subfolder in the post url"
|
|
);
|
|
});
|