alias Pleroma.Web.Preload.Providers.Provider
@behaviour Provider
- @instance_url :"/api/v1/instance"
- @panel_url :"/instance/panel.html"
- @nodeinfo_url :"/nodeinfo/2.0.json"
+ @instance_url "/api/v1/instance"
+ @panel_url "/instance/panel.html"
+ @nodeinfo_url "/nodeinfo/2.0.json"
@impl Provider
def generate_terms(_params) do
alias Pleroma.Web.TwitterAPI.UtilController
@behaviour Provider
- @config_url :"/api/statusnet/config.json"
+ @config_url "/api/statusnet/config.json"
@impl Provider
def generate_terms(_params) do
alias Pleroma.Web.Preload.Providers.Provider
@behaviour Provider
- @public_url :"/api/v1/timelines/public"
+ @public_url "/api/v1/timelines/public"
@impl Provider
def generate_terms(params) do
alias Pleroma.Web.Preload.Providers.Provider
@behaviour Provider
- @account_url_base :"/api/v1/accounts"
+ @account_url_base "/api/v1/accounts"
@impl Provider
def generate_terms(%{user: user}) do
def build_accounts_tag(acc, %User{} = user) do
account_data = AccountView.render("show.json", %{user: user, for: user})
- Map.put(acc, :"#{@account_url_base}/#{user.id}", account_data)
+ Map.put(acc, "#{@account_url_base}/#{user.id}", account_data)
end
def build_accounts_tag(acc, _), do: acc
setup do: {:ok, Instance.generate_terms(nil)}
- test "it renders the info", %{"/api/v1/instance": info} do
+ test "it renders the info", %{"/api/v1/instance" => info} do
assert %{
description: description,
email: "admin@example.com",
assert String.equivalent?(description, "Pleroma: An efficient and flexible fediverse server")
end
- test "it renders the panel", %{"/instance/panel.html": panel} do
+ test "it renders the panel", %{"/instance/panel.html" => panel} do
assert String.contains?(
panel,
"<p>Welcome to <a href=\"https://pleroma.social\" target=\"_blank\">Pleroma!</a></p>"
)
end
- test "it renders the node_info", %{"/nodeinfo/2.0.json": nodeinfo} do
+ test "it renders the node_info", %{"/nodeinfo/2.0.json" => nodeinfo} do
%{
metadata: metadata,
version: "2.0"
setup do: {:ok, StatusNet.generate_terms(nil)}
- test "it renders the info", %{"/api/statusnet/config.json": info} do
+ test "it renders the info", %{"/api/statusnet/config.json" => info} do
assert {:ok, res} = Jason.decode(info)
assert res["site"]
end
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.Preload.Providers.Timelines
- @public_url :"/api/v1/timelines/public"
+ @public_url "/api/v1/timelines/public"
describe "unauthenticated timeliness when restricted" do
setup do
end
test "account is rendered", %{terms: terms, user: user} do
- account = terms[:"/api/v1/accounts/#{user.id}"]
+ account = terms["/api/v1/accounts/#{user.id}"]
assert %{acct: user, username: user} = account
end
end