# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.OpenSearchControllerTest do
use Pleroma.Web.ConnCase, async: false
alias Pleroma.Config
alias Pleroma.Web.Endpoint
test "opensearch.xml", %{conn: conn} do
resp =
conn
|> put_req_header("accept", "application/opensearchdescription+xml")
|> get("/opensearch.xml")
|> response(200)
assert resp =~ "#{Config.get([:instance, :name])}"
assert resp =~ "Search through #{Config.get([:instance, :name])}"
assert resp =~ "template=\"#{Endpoint.url()}/search?query={searchTerms}\""
end
end