mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Use heredoc on the HTML
blocks in verify link spec (#29365)
This commit is contained in:
parent
9d8dfeb5fb
commit
a6ed148769
1 changed files with 11 additions and 7 deletions
|
@ -77,11 +77,11 @@ RSpec.describe VerifyLinkService, type: :service do
|
|||
|
||||
context 'when a document is truncated but the link back is valid' do
|
||||
let(:html) do
|
||||
"
|
||||
<<-HTML
|
||||
<!doctype html>
|
||||
<body>
|
||||
<a rel=\"me\" href=\"#{ActivityPub::TagManager.instance.url_for(account)}\">
|
||||
"
|
||||
<a rel="me" href="#{ActivityPub::TagManager.instance.url_for(account)}">
|
||||
HTML
|
||||
end
|
||||
|
||||
it 'marks the field as verified' do
|
||||
|
@ -91,11 +91,11 @@ RSpec.describe VerifyLinkService, type: :service do
|
|||
|
||||
context 'when a link tag might be truncated' do
|
||||
let(:html) do
|
||||
"
|
||||
<<-HTML_TRUNCATED
|
||||
<!doctype html>
|
||||
<body>
|
||||
<a rel=\"me\" href=\"#{ActivityPub::TagManager.instance.url_for(account)}\"
|
||||
"
|
||||
<a rel="me" href="#{ActivityPub::TagManager.instance.url_for(account)}"
|
||||
HTML_TRUNCATED
|
||||
end
|
||||
|
||||
it 'marks the field as not verified' do
|
||||
|
@ -166,7 +166,11 @@ RSpec.describe VerifyLinkService, type: :service do
|
|||
#
|
||||
# apparently github allows the user to enter website URLs with a single
|
||||
# slash and makes no attempts to correct that.
|
||||
let(:html) { '<a href="http:/unrelated.example">Hello</a>' }
|
||||
let(:html) do
|
||||
<<-HTML
|
||||
<a href="http:/unrelated.example">Hello</a>
|
||||
HTML
|
||||
end
|
||||
|
||||
it 'does not crash' do
|
||||
# We could probably put more effort into perhaps auto-correcting the
|
||||
|
|
Loading…
Reference in a new issue