add tests for JSON-LD drop

This commit is contained in:
Ben Balter 2017-08-23 16:20:02 -04:00
parent 5de6cd7f2c
commit cf49c63b3c
No known key found for this signature in database
GPG Key ID: DBB67C246AD356C4
2 changed files with 11 additions and 6 deletions

View File

@ -479,4 +479,8 @@ RSpec.describe Jekyll::SeoTag::Drop do
end
end
end
it "exposes the JSON-LD drop" do
expect(subject.json_ld).to be_a(Jekyll::SeoTag::JSONLDDrop)
end
end

View File

@ -1,8 +1,4 @@
RSpec.describe Jekyll::SeoTag::JSONLD do
before do
Jekyll.logger.log_level = :error
end
RSpec.describe Jekyll::SeoTag::JSONLDDrop do
let(:author) { "author" }
let(:image) { "image" }
let(:metadata) do
@ -28,7 +24,12 @@ RSpec.describe Jekyll::SeoTag::JSONLD do
let(:page) { make_page(metadata) }
let(:site) { make_site(config) }
let(:context) { make_context(:page => page, :site => site) }
subject { Jekyll::SeoTag::Drop.new("", context).json_ld }
let(:page_drop) { Jekyll::SeoTag::Drop.new("", context) }
subject { described_class.new(page_drop) }
before do
Jekyll.logger.log_level = :error
end
it "returns the context" do
expect(subject).to have_key("@context")