Skip to content

Commit

Permalink
Merge branch 'map-field' of https://github.com/van-mronov/phoenix int…
Browse files Browse the repository at this point in the history
…o van-mronov-map-field
  • Loading branch information
chrismccord committed Mar 13, 2019
2 parents 7dcb06c + 595e048 commit bd5e012
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion priv/templates/phx.gen.json/controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web

assert %{
"id" => id<%= for {key, val} <- schema.params.create do %>,
"<%= key %>" => <%= Phoenix.json_library().encode!(val) %><% end %>
"<%= key %>" => <%= if val == %{}, do: "%{}", else: Phoenix.json_library().encode!(val) %><% end %>
} = json_response(conn, 200)["data"]
end

Expand Down
2 changes: 2 additions & 0 deletions test/mix/tasks/phx.gen.json_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ defmodule Mix.Tasks.Phx.Gen.JsonTest do
in_tmp_project config.test, fn ->
Gen.Json.run(~w(Blog Post posts title slug:unique votes:integer cost:decimal
tags:array:text popular:boolean drafted_at:datetime
params:map
published_at:utc_datetime
published_at_usec:utc_datetime_usec
deleted_at:naive_datetime
Expand Down Expand Up @@ -67,6 +68,7 @@ defmodule Mix.Tasks.Phx.Gen.JsonTest do
"deleted_at" => "2010-04-17T14:00:00",
"deleted_at_usec" => "2010-04-17T14:00:00.000000",
"drafted_at" => "2010-04-17T14:00:00",
"params" => %{},
"popular" => true,
"published_at" => "2010-04-17T14:00:00Z",
"published_at_usec" => "2010-04-17T14:00:00.000000Z",
Expand Down

0 comments on commit bd5e012

Please sign in to comment.