diff --git a/apps/fg_http/test/fg_http/util/fg_crypto_test.exs b/apps/fg_http/test/fg_http/util/fg_crypto_test.exs new file mode 100644 index 000000000..eb97c67b2 --- /dev/null +++ b/apps/fg_http/test/fg_http/util/fg_crypto_test.exs @@ -0,0 +1,17 @@ +defmodule FgHttp.Util.FgCryptoTest do + use ExUnit.Case, async: true + + alias FgHttp.Util.FgCrypto + + describe "rand_string" do + test "it returns a string of default length" do + assert 16 == String.length(FgCrypto.rand_string()) + end + + test "it returns a string of proper length" do + for length <- [1, 32, 32_768] do + assert length == String.length(FgCrypto.rand_string(length)) + end + end + end +end