mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Consistently use response
helper (#17627)
This commit is contained in:
@ -3,7 +3,7 @@ import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
||||
import { click, render } from "@ember/test-helpers";
|
||||
import { count, exists, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import hbs from "htmlbars-inline-precompile";
|
||||
import pretender from "discourse/tests/helpers/create-pretender";
|
||||
import pretender, { response } from "discourse/tests/helpers/create-pretender";
|
||||
import EmberObject from "@ember/object";
|
||||
import I18n from "I18n";
|
||||
|
||||
@ -15,33 +15,29 @@ module("Integration | Component | Widget | discourse-poll", function (hooks) {
|
||||
hooks.beforeEach(function () {
|
||||
pretender.put("/polls/vote", () => {
|
||||
++requests;
|
||||
return [
|
||||
200,
|
||||
{ "Content-Type": "application/json" },
|
||||
{
|
||||
poll: {
|
||||
name: "poll",
|
||||
type: "regular",
|
||||
status: "open",
|
||||
results: "always",
|
||||
options: [
|
||||
{
|
||||
id: "1f972d1df351de3ce35a787c89faad29",
|
||||
html: "yes",
|
||||
votes: 1,
|
||||
},
|
||||
{
|
||||
id: "d7ebc3a9beea2e680815a1e4f57d6db6",
|
||||
html: "no",
|
||||
votes: 0,
|
||||
},
|
||||
],
|
||||
voters: 1,
|
||||
chart_type: "bar",
|
||||
},
|
||||
vote: ["1f972d1df351de3ce35a787c89faad29"],
|
||||
return response({
|
||||
poll: {
|
||||
name: "poll",
|
||||
type: "regular",
|
||||
status: "open",
|
||||
results: "always",
|
||||
options: [
|
||||
{
|
||||
id: "1f972d1df351de3ce35a787c89faad29",
|
||||
html: "yes",
|
||||
votes: 1,
|
||||
},
|
||||
{
|
||||
id: "d7ebc3a9beea2e680815a1e4f57d6db6",
|
||||
html: "no",
|
||||
votes: 0,
|
||||
},
|
||||
],
|
||||
voters: 1,
|
||||
chart_type: "bar",
|
||||
},
|
||||
];
|
||||
vote: ["1f972d1df351de3ce35a787c89faad29"],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user