diff options
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/verify_link_service_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/services/verify_link_service_spec.rb b/spec/services/verify_link_service_spec.rb index 52ba454cc..391560f1c 100644 --- a/spec/services/verify_link_service_spec.rb +++ b/spec/services/verify_link_service_spec.rb @@ -73,6 +73,33 @@ RSpec.describe VerifyLinkService, type: :service do end end + context 'when a document is truncated but the link back is valid' do + let(:html) do + " + <!doctype html> + <body> + <a rel=\"me\" href=\"#{ActivityPub::TagManager.instance.url_for(account)}\" + " + end + + it 'marks the field as not verified' do + expect(field.verified?).to be false + end + end + + context 'when a link back might be truncated' do + let(:html) do + " + <!doctype html> + <body> + <a rel=\"me\" href=\"#{ActivityPub::TagManager.instance.url_for(account)}" + end + + it 'does not mark the field as verified' do + expect(field.verified?).to be false + end + end + context 'when a link does not contain a link back' do let(:html) { '' } |