Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add tests for twitter.card types #289

Merged
merged 1 commit into from
May 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions spec/jekyll_seo_tag_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,34 @@
end

context "with page.image" do
let(:page) { make_page("image" => "/img/foo.png") }
context "without *.twitter.card" do
let(:page) { make_page("image" => "/img/foo.png") }

it "outputs summary card with large image" do
expected = %r!<meta name="twitter:card" content="summary_large_image" />!
expect(output).to match(expected)
it "outputs summary card with large image" do
expected = %r!<meta name="twitter:card" content="summary_large_image" />!
expect(output).to match(expected)
end
end

context "with page.twitter.card" do
let(:page_twitter) { { "card" => "summary" } }
let(:page) { make_page("image" => "/img/foo.png", "twitter" => page_twitter) }

it "outputs summary card with small image" do
expected = %r!<meta name="twitter:card" content="summary" />!
expect(output).to match(expected)
end
end

context "with site.twitter.card" do
let(:site_twitter) { { "username" => "jekyllrb", "card" => "summary" } }
let(:site) { make_site("twitter" => site_twitter) }
let(:page) { make_page("image" => "/img/foo.png") }

it "outputs summary card with small image" do
expected = %r!<meta name="twitter:card" content="summary" />!
expect(output).to match(expected)
end
end
end

Expand Down