mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 04:29:29 +08:00
DEV: Remove invalid pretender calls (#18341)
Get parameters cannot be included in the URL of request stubs. Instead, the callback can check `request.queryParams` to modify behavior.
This commit is contained in:
parent
7277a9fbb3
commit
8964749989
|
@ -8,9 +8,6 @@ import { test } from "qunit";
|
|||
|
||||
acceptance("Redirect to Top", function (needs) {
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/top.json?period=weekly", () => {
|
||||
return helper.response(DiscoveryFixtures["/latest.json"]);
|
||||
});
|
||||
server.get("/top/monthly.json", () => {
|
||||
return helper.response(DiscoveryFixtures["/latest.json"]);
|
||||
});
|
||||
|
|
|
@ -201,15 +201,11 @@ acceptance("Topic Discovery | Footer", function (needs) {
|
|||
});
|
||||
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/c/dev/7/l/latest.json", () => {
|
||||
server.get("/c/dev/7/l/latest.json", (request) => {
|
||||
const json = cloneJSON(discoveryFixtures["/c/dev/7/l/latest.json"]);
|
||||
json.topic_list.more_topics_url = "/c/dev/7/l/latest.json?page=2";
|
||||
return helper.response(json);
|
||||
});
|
||||
|
||||
server.get("/c/dev/7/l/latest.json?page=2", () => {
|
||||
const json = cloneJSON(discoveryFixtures["/c/dev/7/l/latest.json"]);
|
||||
json.topic_list.more_topics_url = null;
|
||||
if (!request.queryParams.page) {
|
||||
json.topic_list.more_topics_url = "/c/dev/7/l/latest.json?page=2";
|
||||
}
|
||||
return helper.response(json);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user