mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 01:12:45 +08:00
parent
c7151f0fd6
commit
bef8468510
|
@ -8,6 +8,7 @@ moduleFor("controller:admin-customize-themes-show", {
|
||||||
needs: ["controller:adminUser"]
|
needs: ["controller:adminUser"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test("can display source url for remote themes", function(assert) {
|
||||||
const repoUrl = "https://github.com/discourse/discourse-brand-header.git";
|
const repoUrl = "https://github.com/discourse/discourse-brand-header.git";
|
||||||
const remoteTheme = Theme.create({
|
const remoteTheme = Theme.create({
|
||||||
id: 2,
|
id: 2,
|
||||||
|
@ -17,9 +18,6 @@ const remoteTheme = Theme.create({
|
||||||
remote_url: repoUrl
|
remote_url: repoUrl
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test("can display source url for remote themes", function(assert) {
|
|
||||||
delete remoteTheme["remote_theme"]["branch"];
|
|
||||||
const controller = this.subject({
|
const controller = this.subject({
|
||||||
model: remoteTheme
|
model: remoteTheme
|
||||||
});
|
});
|
||||||
|
@ -34,17 +32,22 @@ QUnit.test("can display source url for remote themes", function(assert) {
|
||||||
QUnit.test("can display source url for remote theme branches", function(
|
QUnit.test("can display source url for remote theme branches", function(
|
||||||
assert
|
assert
|
||||||
) {
|
) {
|
||||||
const branchUrl =
|
const remoteTheme = Theme.create({
|
||||||
"https://github.com/discourse/discourse-brand-header/tree/beta";
|
id: 2,
|
||||||
remoteTheme["remote_theme"]["branch"] = "beta";
|
default: true,
|
||||||
|
name: "default",
|
||||||
|
remote_theme: {
|
||||||
|
remote_url: "https://github.com/discourse/discourse-brand-header.git",
|
||||||
|
branch: "beta"
|
||||||
|
}
|
||||||
|
});
|
||||||
const controller = this.subject({
|
const controller = this.subject({
|
||||||
model: remoteTheme
|
model: remoteTheme
|
||||||
});
|
});
|
||||||
|
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
controller.get("remoteThemeLink"),
|
controller.get("remoteThemeLink"),
|
||||||
branchUrl,
|
"https://github.com/discourse/discourse-brand-header/tree/beta",
|
||||||
"returns theme's repo URL to branch"
|
"returns theme's repo URL to branch"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user