phoenix / testing dates in controllers
问题 Having the following basic test (using ex_machina) : # factory def item_factory do %Api.Content.Item{ title: "Some title", content: "Some content", published_at: NaiveDateTime.utc_now } end # test test "lists all items", %{conn: conn} do item = insert(:item) conn = get conn, item_path(conn, :index) assert json_response(conn, 200)["data"] == [ %{ "content" => item.content, "published_at" => item.published_at, "title" => item.title, "id" => item.id } ] end Am getting an error on the date : left