diff --git a/test/parser_test.exs b/test/parser_test.exs index 0d9712b..096f0a1 100644 --- a/test/parser_test.exs +++ b/test/parser_test.exs @@ -7,11 +7,36 @@ defmodule ParserTest do params = %{ "type" => ["h-entry"], "properties" => %{ - "content" => "Hello World!" + "name" => ["First Note"], + "content" => ["Hello World!"], + "category" => ["Foo", "Bar"] } } - assert {:ok, "entry", %{"content" => "Hello World!"}} = + assert {:ok, "entry", + %{ + "content" => ["Hello World!"], + "category" => ["Foo", "Bar"], + "name" => ["First Note"] + }} == parse_create_body("application/json", params) end + + test "parse_create_body with content-type form" do + params = %{ + "h" => "entry", + "name" => "First Note", + "content" => "Hello World!", + "category" => ["Foo", "Bar"] + } + + # TODO: fix content type + assert {:ok, "entry", + %{ + "content" => ["Hello World!"], + "category" => ["Foo", "Bar"], + "name" => ["First Note"] + }} == + parse_create_body("application/form", params) + end end