summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-08-27 14:28:45 -0700
committerRobert Speicher <rspeicher@gmail.com>2015-08-27 14:28:45 -0700
commita4e4fde3e68a5c27e0424bdbe0dbd87d33a9e020 (patch)
treee2613e4057b8c30559fb58b60476407d8945a338 /spec
parent4340dd3eeb6fdda83b729c16cba29239b8ed9f43 (diff)
downloadgitlab-ce-a4e4fde3e68a5c27e0424bdbe0dbd87d33a9e020.tar.gz
Restore the forwarded HTML options in link_to_gfm
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/gitlab_markdown_helper_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb
index d1ca2337a9b..0f9c587432d 100644
--- a/spec/helpers/gitlab_markdown_helper_spec.rb
+++ b/spec/helpers/gitlab_markdown_helper_spec.rb
@@ -79,6 +79,16 @@ describe GitlabMarkdownHelper do
expect(doc.css('a')[4].text).to eq ' for real'
end
+ it 'should forward HTML options' do
+ actual = link_to_gfm("Fixed in #{commit.id}", commit_path, class: 'foo')
+ doc = Nokogiri::HTML.parse(actual)
+
+ expect(doc.css('a')).to satisfy do |v|
+ # 'foo' gets added to all links
+ v.all? { |a| a.attr('class').match(/foo$/) }
+ end
+ end
+
it "escapes HTML passed in as the body" do
actual = "This is a <h1>test</h1> - see #{issues[0].to_reference}"
expect(link_to_gfm(actual, commit_path)).