Skip to content

Commit 193a12e

Browse files
committed
test: add decode
1 parent c2c8082 commit 193a12e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

test/web_push_elixir_test.exs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
defmodule WebPushElixirTest do
22
use ExUnit.Case
3-
doctest WebPushElixir
43

5-
test "greets the world" do
6-
assert WebPushElixir.hello() == :world
4+
test "it should decode" do
5+
assert Jason.decode!(
6+
'{"endpoint":"https://some.pushservice.com/something-unique","keys":{"p256dh":"BIPUL12DLfytvTajnryr2PRdAgXS3HGKiLqndGcJGabyhHheJYlNGCeXl1dn18gSJ1WAkAPIxr4gK0_dQds4yiI=","auth":"FPssNDTKnInHVndSTdbKFw=="}}'
7+
) == %{
8+
"endpoint" => "https://some.pushservice.com/something-unique",
9+
"keys" => %{
10+
"auth" => "FPssNDTKnInHVndSTdbKFw==",
11+
"p256dh" =>
12+
"BIPUL12DLfytvTajnryr2PRdAgXS3HGKiLqndGcJGabyhHheJYlNGCeXl1dn18gSJ1WAkAPIxr4gK0_dQds4yiI="
13+
}
14+
}
715
end
816
end

0 commit comments

Comments
 (0)