Commit 210aa42f authored by feld's avatar feld
Browse files

Merge branch 'application-to-generator' into 'develop'

Status application field: test improvements

See merge request !3356
parents 4cb166e9 ccbf1620
Pipeline #35320 passed with stages
in 82 minutes and 47 seconds
......@@ -536,6 +536,8 @@ defp build_emoji_map(emoji, users, current_user) do
end
@spec build_application(map() | nil) :: map() | nil
defp build_application(%{type: _type, name: name, url: url}), do: %{name: name, website: url}
defp build_application(%{"type" => _type, "name" => name, "url" => url}),
do: %{name: name, website: url}
defp build_application(_), do: nil
end
......@@ -376,6 +376,17 @@ test "discloses application metadata when enabled" do
"status" => "cofe is my copilot"
})
assert %{
"content" => "cofe is my copilot"
} = json_response_and_validate_schema(result, 200)
activity = result.assigns.activity.id
result =
conn
|> put_req_header("content-type", "application/json")
|> get("api/v1/statuses/#{activity}")
assert %{
"content" => "cofe is my copilot",
"application" => %{
......@@ -396,6 +407,16 @@ test "hides application metadata when disabled" do
"status" => "club mate is my wingman"
})
assert %{"content" => "club mate is my wingman"} =
json_response_and_validate_schema(result, 200)
activity = result.assigns.activity.id
result =
conn
|> put_req_header("content-type", "application/json")
|> get("api/v1/statuses/#{activity}")
assert %{
"content" => "club mate is my wingman",
"application" => nil
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment