2024-11-29 09:39:35 +00:00
|
|
|
defmodule ParserTest do
|
|
|
|
use ExUnit.Case
|
2024-11-29 09:42:27 +00:00
|
|
|
doctest PlugIndie.Parser
|
|
|
|
import PlugIndie.Parser, only: [parse_create_body: 2]
|
2024-11-29 09:39:35 +00:00
|
|
|
|
|
|
|
test "parse_create_body with content-type json" do
|
|
|
|
params = %{
|
|
|
|
"type" => ["h-entry"],
|
|
|
|
"properties" => %{
|
|
|
|
"content" => "Hello World!"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
assert {:ok, "entry", %{"content" => "Hello World!"}} =
|
|
|
|
parse_create_body("application/json", params)
|
|
|
|
end
|
|
|
|
end
|