From fad015764cb2d550af0210e2158ecdead4b4bdeb Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 27 Apr 2015 22:09:29 -0400 Subject: More gitlab_markdown_helper_spec cleanup --- spec/helpers/gitlab_markdown_helper_spec.rb | 57 +---------------------------- 1 file changed, 1 insertion(+), 56 deletions(-) (limited to 'spec') diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb index ff0f049ce6c..b6be82e4109 100644 --- a/spec/helpers/gitlab_markdown_helper_spec.rb +++ b/spec/helpers/gitlab_markdown_helper_spec.rb @@ -107,8 +107,7 @@ describe GitlabMarkdownHelper do end it 'should not be confused by whitespace before bullets' do - rendered_text_asterisk = markdown(@source_text_asterisk, - parse_tasks: true) + rendered_text_asterisk = markdown(@source_text_asterisk, parse_tasks: true) rendered_text_dash = markdown(@source_text_dash, parse_tasks: true) expect(rendered_text_asterisk).to match( @@ -207,61 +206,7 @@ describe GitlabMarkdownHelper do end describe "#markdown" do - # REFERENCES (PART TWO: THE REVENGE) --------------------------------------- - - it "should handle references in headers" do - actual = "\n# Working around ##{issue.iid}\n## Apply !#{merge_request.iid}" - - expect(markdown(actual, no_header_anchors: true)). - to match(%r{Working around ##{issue.iid}}) - expect(markdown(actual, no_header_anchors: true)). - to match(%r{Apply !#{merge_request.iid}}) - end - - it "should handle references in " do - actual = "Apply _!#{merge_request.iid}_ ASAP" - - expect(markdown(actual)). - to match(%r{Apply !#{merge_request.iid}}) - end - - # CODE BLOCKS ------------------------------------------------------------- - - it "should leave code blocks untouched" do - allow(helper).to receive(:current_user).and_return(user) - allow(helper).to receive(:user_color_scheme_class).and_return(:white) - - target_html = "
some code from $#{snippet.id}\nhere too\n
\n" - - expect(markdown("\n some code from $#{snippet.id}\n here too\n")). - to eq(target_html) - expect(markdown("\n```\nsome code from $#{snippet.id}\nhere too\n```\n")). - to eq(target_html) - end - - it "should leave inline code untouched" do - expect(markdown("Don't use `$#{snippet.id}` here.")). - to eq "

Don't use $#{snippet.id} here.

\n" - end - - # REF-LIKE AUTOLINKS? ----------------------------------------------------- - # Basically: Don't parse references inside `` tags. - - it "should leave ref-like autolinks untouched" do - expect(markdown("look at http://example.tld/#!#{merge_request.iid}")).to eq("

look at http://example.tld/#!#{merge_request.iid}

\n") - end - - it "should leave ref-like href of 'manual' links untouched" do - expect(markdown("why not [inspect !#{merge_request.iid}](http://example.tld/#!#{merge_request.iid})")).to eq("

why not inspect !#{merge_request.iid}

\n") - end - - it "should leave ref-like src of images untouched" do - expect(markdown("screen shot: ![some image](http://example.tld/#!#{merge_request.iid})")).to eq("

screen shot: \"some

\n") - end - - # RELATIVE URLS ----------------------------------------------------------- # TODO (rspeicher): These belong in a relative link filter spec - context 'relative links' do context 'with a valid repository' do before do -- cgit v1.2.1