fix: pretty-print json on serialisation to filesystem
This commit is contained in:
@@ -99,6 +99,10 @@ defmodule BDS.MetadataTest do
|
||||
category_meta_path = Path.join([temp_dir, "meta", "category-meta.json"])
|
||||
publishing_path = Path.join([temp_dir, "meta", "publishing.json"])
|
||||
|
||||
assert File.read!(categories_path) =~ "\n"
|
||||
assert File.read!(category_meta_path) =~ "\n"
|
||||
assert File.read!(publishing_path) =~ "\n"
|
||||
|
||||
assert ["article", "aside", "news", "page", "picture"] =
|
||||
Jason.decode!(File.read!(categories_path))
|
||||
|
||||
|
||||
@@ -30,8 +30,12 @@ defmodule BDS.TagsTest do
|
||||
tags_path = Path.join([temp_dir, "meta", "tags.json"])
|
||||
assert File.exists?(tags_path)
|
||||
|
||||
contents = File.read!(tags_path)
|
||||
assert contents =~ "\n"
|
||||
refute String.contains?(contents, "}],[")
|
||||
|
||||
assert [%{"name" => "Alpha"}, %{"color" => "#000000", "name" => "Zebra"}] =
|
||||
Jason.decode!(File.read!(tags_path))
|
||||
Jason.decode!(contents)
|
||||
end
|
||||
|
||||
test "create_tag rejects case-insensitive duplicates per project", %{project: project} do
|
||||
|
||||
Reference in New Issue
Block a user