diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-04-21 21:03:37 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-04-21 22:38:44 +0300 |
commit | 72debd840cb76a5fc0929c0caeca179c39378680 (patch) | |
tree | ba0c646f27408f667c181176cfb04a1026df82b4 /spec/lib | |
parent | dbe06ac790befe2d49dbb6edecb79d82abfe46e7 (diff) |
Fix failing spec
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/banzai/filter/external_link_filter_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/lib/banzai/filter/external_link_filter_spec.rb b/spec/lib/banzai/filter/external_link_filter_spec.rb index e3a8e15330e..f4c5c621bd0 100644 --- a/spec/lib/banzai/filter/external_link_filter_spec.rb +++ b/spec/lib/banzai/filter/external_link_filter_spec.rb @@ -24,6 +24,14 @@ describe Banzai::Filter::ExternalLinkFilter, lib: true do doc = filter(act) expect(doc.at_css('a')).to have_attribute('rel') - expect(doc.at_css('a')['rel']).to eq 'nofollow' + expect(doc.at_css('a')['rel']).to include 'nofollow' + end + + it 'adds rel="noreferrer" to external links' do + act = %q(<a href="https://google.com/">Google</a>) + doc = filter(act) + + expect(doc.at_css('a')).to have_attribute('rel') + expect(doc.at_css('a')['rel']).to include 'noreferrer' end end |