add failing tests for stripping null values

This commit is contained in:
Ben Balter 2017-11-16 11:39:26 -05:00
parent 232d9f91ec
commit ca1200b90f
No known key found for this signature in database
GPG Key ID: DBB67C246AD356C4
2 changed files with 12 additions and 0 deletions

View File

@ -152,4 +152,12 @@ RSpec.describe Jekyll::SeoTag::JSONLDDrop do
expect(subject).to have_key("url")
expect(subject["url"]).to eql("/page.html")
end
context "with null values" do
let(:metadata) { {} }
it "does not return null values as json" do
expect(subject.to_json).to_not match(/:null/)
end
end
end

View File

@ -338,6 +338,10 @@ EOS
it "minifies JSON-LD" do
expect(output).to_not match(%r!{.*?\s.*?}!)
end
it "removes null values from JSON-LD" do
expect(output).to_not match(/:null/)
end
end
end