17 lines
429 B
Elixir
17 lines
429 B
Elixir
defmodule ParserTest do
|
|
use ExUnit.Case
|
|
doctest PlugIndie.Parser
|
|
import PlugIndie.Parser, only: [parse_create_body: 2]
|
|
|
|
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
|