Skip to content

Commit

Permalink
Change preview urls to use pull request number instead of branch
Browse files Browse the repository at this point in the history
  • Loading branch information
tobie committed Nov 23, 2017
1 parent 07b36c4 commit 79441ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/mixins/mutable-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const cache = require("../cache");
module.exports = (superclass) => class extends superclass {
// owner/repo/branch.html
get key() {
return `${ this.owner }/${ this.repo }/${ this.branch }.html`;
return `${ this.owner }/${ this.repo }/pull/${ this.pr.number }.html`;
}

get cache_url() {
Expand Down
6 changes: 3 additions & 3 deletions test/models/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ suite("Branch model", function() {
assert.equal(h.sha, "7dfd134ee2e6df7fe0af770783a6b76a3fc56867");
assert.equal(h.short_sha, "7dfd134");
assert.equal(b.key, "heycam/webidl/gh-pages/3834774.html");
assert.equal(h.key, "tobie/webidl/interface-objs.html");
assert.equal(h.cache_url, "https://s3.amazonaws.com/bar/tobie/webidl/interface-objs.html");
assert.equal(h.key, "tobie/webidl/pull/283.html");
assert.equal(h.cache_url, "https://s3.amazonaws.com/bar/tobie/webidl/pull/283.html");
h.pr.config = { src_file: "foo.bs" };
assert.equal(h.github_url, "https://raw.githubusercontent.com/tobie/webidl/7dfd134ee2e6df7fe0af770783a6b76a3fc56867/foo.bs");
assert.equal(h.rawgit_url, "https://cdn.rawgit.com/tobie/webidl/7dfd134ee2e6df7fe0af770783a6b76a3fc56867/foo.bs");
Expand Down Expand Up @@ -208,7 +208,7 @@ suite("Branch model", function() {
branch: "interface-objs",
sha: "7dfd134ee2e6df7fe0af770783a6b76a3fc56867",
short_sha: "7dfd134",
url: "https://s3.amazonaws.com/bar/tobie/webidl/interface-objs.html"
url: "https://s3.amazonaws.com/bar/tobie/webidl/pull/283.html"
});
});
});

0 comments on commit 79441ae

Please sign in to comment.