Merge branch 'bugfix/poll-id-as-string' into 'develop'

Status View: Poll ids are strings.

See merge request 
This commit is contained in:
rinpatch 2019-07-16 06:06:22 +00:00
commit 996fd58ac4
3 changed files with 3 additions and 3 deletions
lib/pleroma/web/mastodon_api/views
test/web/mastodon_api

View file

@ -382,7 +382,7 @@ def render("poll.json", %{object: object} = opts) do
%{
# Mastodon uses separate ids for polls, but an object can't have
# more than one poll embedded so object id is fine
id: object.id,
id: to_string(object.id),
expires_at: Utils.to_masto_date(end_time),
expired: expired,
multiple: multiple,

View file

@ -3576,7 +3576,7 @@ test "returns poll entity for object id", %{conn: conn} do
|> get("/api/v1/polls/#{object.id}")
response = json_response(conn, 200)
id = object.id
id = to_string(object.id)
assert %{"id" => ^id, "expired" => false, "multiple" => false} = response
end

View file

@ -423,7 +423,7 @@ test "renders a poll" do
expected = %{
emojis: [],
expired: false,
id: object.id,
id: to_string(object.id),
multiple: false,
options: [
%{title: "absolutely!", votes_count: 0},