-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove article body from structured data
- Loading branch information
1 parent
de0f9f9
commit afd6d0b
Showing
4 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defmodule Tilex.StructuredDataViewTest do | ||
use ExUnit.Case, async: true | ||
alias TilexWeb.StructuredDataView | ||
|
||
@ld_json_data [ | ||
{%{}, "{}"}, | ||
{%{foo: :bar}, "{\"foo\":\"bar\"}"}, | ||
{%{foo: nil}, "{\"foo\":null}"}, | ||
{%{foo: []}, "{\"foo\":[]}"}, | ||
{%{foo: [1, "a"]}, "{\"foo\":[1,\"a\"]}"} | ||
] | ||
|
||
describe "to_ld_json" do | ||
for {input, output} <- @ld_json_data do | ||
@input input | ||
@output output | ||
|
||
test "renders ld_json from data: '#{inspect(@input)}'" do | ||
assert StructuredDataView.to_ld_json(@input) == {:safe, @output} | ||
end | ||
end | ||
end | ||
end |