Fix tests
This commit is contained in:
parent
5af9ce4a01
commit
97f947deaf
|
@ -227,16 +227,29 @@ defp ok_response do
|
||||||
|
|
||||||
defp emoji_packs_response do
|
defp emoji_packs_response do
|
||||||
Operation.response(
|
Operation.response(
|
||||||
"Object with pack names as keys and pack contents as values",
|
"Emoji packs and the count",
|
||||||
"application/json",
|
"application/json",
|
||||||
%Schema{
|
%Schema{
|
||||||
type: :object,
|
type: :object,
|
||||||
|
properties: %{
|
||||||
|
packs: %Schema{
|
||||||
|
type: :object,
|
||||||
|
description: "Object with pack names as keys and pack contents as values",
|
||||||
additionalProperties: %Schema{
|
additionalProperties: %Schema{
|
||||||
emoji_pack()
|
emoji_pack()
|
||||||
| extensions: %{"x-additionalPropertiesName": "Pack name"}
|
| extensions: %{"x-additionalPropertiesName": "Pack name"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
count: %Schema{
|
||||||
|
type: :integer,
|
||||||
|
description: "Number of emoji packs"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
example: %{
|
example: %{
|
||||||
|
"packs" => %{
|
||||||
"emojos" => emoji_pack().example
|
"emojos" => emoji_pack().example
|
||||||
|
},
|
||||||
|
"count" => 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -269,15 +269,12 @@ def update_credentials(%{assigns: %{user: user}, body_params: params} = conn, _p
|
||||||
end
|
end
|
||||||
|
|
||||||
defp normalize_fields_attributes(fields) do
|
defp normalize_fields_attributes(fields) do
|
||||||
if Enum.all?(fields, &is_tuple/1) do
|
if(Enum.all?(fields, &is_tuple/1), do: Enum.map(fields, fn {_, v} -> v end), else: fields)
|
||||||
Enum.map(fields, fn {_, v} -> v end)
|
|> Enum.map(fn
|
||||||
else
|
|
||||||
Enum.map(fields, fn
|
|
||||||
%{} = field -> %{"name" => field.name, "value" => field.value}
|
%{} = field -> %{"name" => field.name, "value" => field.value}
|
||||||
field -> field
|
field -> field
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
@doc "GET /api/v1/accounts/relationships"
|
@doc "GET /api/v1/accounts/relationships"
|
||||||
def relationships(%{assigns: %{user: user}} = conn, %{id: id}) do
|
def relationships(%{assigns: %{user: user}} = conn, %{id: id}) do
|
||||||
|
|
Loading…
Reference in New Issue