From a912308340ec70f13de98ae5116a8d71929a995f Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 9 Oct 2014 16:12:17 +0200 Subject: Add a test for apostrophe in code blocks. --- spec/helpers/gitlab_markdown_helper_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb index 55270a9c204..0784834924c 100644 --- a/spec/helpers/gitlab_markdown_helper_spec.rb +++ b/spec/helpers/gitlab_markdown_helper_spec.rb @@ -539,6 +539,14 @@ describe GitlabMarkdownHelper do markdown(actual).should match(expected) end + it "should not link the apostrophe to issue 39 in code blocks" do + project.team << [user, :master] + project.issues.stub(:where).with(iid: '39').and_return([issue]) + + actual = "Yes, `it is @#{member.user.username}'s task.`" + expected = /Yes, it is @gfm\'s task.<\/code>/ + markdown(actual).should match(expected) + end it "should handle references in " do actual = "Apply _!#{merge_request.iid}_ ASAP" -- cgit v1.2.1