X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fmigrations%2F20200722185515_fix_malformed_formatter_config_test.exs;h=d3490478e0a62f24d13a63eadde5f80fd0ad0600;hb=74be4de3f6c2c34447029649526637411acfa9f3;hp=9e8f997a01ca556f07489718a4dbe8d8cb1c726a;hpb=c7a0016f9f4731c58a7989c7ee10e19d3f90d2eb;p=akkoma
diff --git a/test/migrations/20200722185515_fix_malformed_formatter_config_test.exs b/test/migrations/20200722185515_fix_malformed_formatter_config_test.exs
index 9e8f997a0..d3490478e 100644
--- a/test/migrations/20200722185515_fix_malformed_formatter_config_test.exs
+++ b/test/migrations/20200722185515_fix_malformed_formatter_config_test.exs
@@ -1,9 +1,10 @@
defmodule Pleroma.Repo.Migrations.FixMalformedFormatterConfigTest do
use Pleroma.DataCase
import Pleroma.Factory
- import Pleroma.Tests.Helpers, only: [require_migration: 1]
+ import Pleroma.Tests.Helpers
alias Pleroma.ConfigDB
+ setup do: clear_config(Pleroma.Formatter)
setup_all do: require_migration("20200722185515_fix_malformed_formatter_config")
test "change/0 converts a map into a list", %{migration: migration} do
@@ -11,7 +12,7 @@ defmodule Pleroma.Repo.Migrations.FixMalformedFormatterConfigTest do
class: false,
extra: true,
new_window: false,
- rel: "ugc",
+ rel: "F",
strip_prefix: false
}
@@ -25,17 +26,20 @@ defmodule Pleroma.Repo.Migrations.FixMalformedFormatterConfigTest do
class: false,
extra: true,
new_window: false,
- rel: "ugc",
+ rel: "F",
strip_prefix: false
]
+ Pleroma.Config.put(Pleroma.Formatter, new_opts)
+ assert new_opts == Pleroma.Config.get(Pleroma.Formatter)
+
{text, _mentions, []} =
Pleroma.Formatter.linkify(
"https://www.businessinsider.com/walmart-will-close-stores-on-thanksgiving-ending-black-friday-tradition-2020-7\n\nOmg will COVID finally end Black Friday???"
)
assert text ==
- "https://www.businessinsider.com/walmart-will-close-stores-on-thanksgiving-ending-black-friday-tradition-2020-7\n\nOmg will COVID finally end Black Friday???"
+ "https://www.businessinsider.com/walmart-will-close-stores-on-thanksgiving-ending-black-friday-tradition-2020-7\n\nOmg will COVID finally end Black Friday???"
end
test "change/0 skips if Pleroma.Formatter config is already a list", %{migration: migration} do