Extract header_tags method in statuses/show view spec (#29907)

This commit is contained in:
Matt Jankowski 2024-04-12 05:50:46 -04:00 committed by GitHub
parent 8986e3b088
commit 61d108f415
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,12 +21,11 @@ describe 'statuses/show.html.haml', :without_verify_partial_doubles do
render
header_tags = view.content_for(:header_tags)
expect(header_tags).to match(/<meta content=".+" property="og:title">/)
expect(header_tags).to match(/<meta content="article" property="og:type">/)
expect(header_tags).to match(/<meta content=".+" property="og:image">/)
expect(header_tags).to match(%r{<meta content="http://.+" property="og:url">})
expect(header_tags)
.to match(/<meta content=".+" property="og:title">/)
.and match(/<meta content="article" property="og:type">/)
.and match(/<meta content=".+" property="og:image">/)
.and match(%r{<meta content="http://.+" property="og:url">})
end
it 'has twitter player tag' do
@ -40,9 +39,12 @@ describe 'statuses/show.html.haml', :without_verify_partial_doubles do
render
header_tags = view.content_for(:header_tags)
expect(header_tags)
.to match(%r{<meta content="http://.+/media/.+/player" property="twitter:player">})
.and match(/<meta content="player" property="twitter:card">/)
end
expect(header_tags).to match(%r{<meta content="http://.+/media/.+/player" property="twitter:player">})
expect(header_tags).to match(/<meta content="player" property="twitter:card">/)
def header_tags
view.content_for(:header_tags)
end
end