X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fdocs%2Fgenerator_test.exs;h=9c9f4357b2836a116d84c0d05d528e4aee2484ab;hb=d67b302810c53d92ace7c347c77eecc10be6bcd6;hp=42e7c32c8022a8e0fb9bfcab6ffaf6bcd6b58e15;hpb=2753285b7722fdb47f0ebb2180e997cf72f65d1a;p=akkoma diff --git a/test/docs/generator_test.exs b/test/docs/generator_test.exs index 42e7c32c8..9c9f4357b 100644 --- a/test/docs/generator_test.exs +++ b/test/docs/generator_test.exs @@ -85,6 +85,12 @@ defmodule Pleroma.Docs.GeneratorTest do key: "application/xml", type: {:list, :string}, suggestions: ["xml"] + }, + %{ + key: :versions, + type: {:list, :atom}, + description: "List of TLS version to use", + suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"] } ] }, @@ -207,5 +213,18 @@ defmodule Pleroma.Docs.GeneratorTest do child = Enum.at(children, 7) assert child[:key] == "application/xml" end + + test "suggestion for tls versions" do + [%{children: children} | _] = Generator.convert_to_strings(@descriptions) + child = Enum.at(children, 8) + assert child[:suggestions] == [":tlsv1", ":tlsv1.1", ":tlsv1.2"] + end + + test "subgroup with module name" do + [%{children: children} | _] = Generator.convert_to_strings(@descriptions) + + %{group: subgroup} = Enum.at(children, 6) + assert subgroup == {":subgroup", "Swoosh.Adapters.SMTP"} + end end end