diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-21 16:35:15 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-05-26 15:49:22 -0400 |
commit | 5a9c5520d9e63a38ed8b839be8430a5b5815da67 (patch) | |
tree | 9419a59b0eb796e77688871a19a8c20daf2809b5 /spec/helpers | |
parent | 68f74aa82690ca83faf81654737f7d0caefdfbd3 (diff) | |
download | gitlab-ce-5a9c5520d9e63a38ed8b839be8430a5b5815da67.tar.gz |
Make use of to_reference in more specs
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/gitlab_markdown_helper_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb index 0d0418f84a7..d0b200a9ff8 100644 --- a/spec/helpers/gitlab_markdown_helper_spec.rb +++ b/spec/helpers/gitlab_markdown_helper_spec.rb @@ -26,7 +26,7 @@ describe GitlabMarkdownHelper do end describe "referencing multiple objects" do - let(:actual) { "!#{merge_request.iid} -> #{commit.id} -> ##{issue.iid}" } + let(:actual) { "#{merge_request.to_reference} -> #{commit.to_reference} -> #{issue.to_reference}" } it "should link to the merge request" do expected = namespace_project_merge_request_path(project.namespace, project, merge_request) @@ -50,7 +50,7 @@ describe GitlabMarkdownHelper do let(:issues) { create_list(:issue, 2, project: project) } it 'should handle references nested in links with all the text' do - actual = link_to_gfm("This should finally fix ##{issues[0].iid} and ##{issues[1].iid} for real", commit_path) + actual = link_to_gfm("This should finally fix #{issues[0].to_reference} and #{issues[1].to_reference} for real", commit_path) doc = Nokogiri::HTML.parse(actual) # Make sure we didn't create invalid markup @@ -63,7 +63,7 @@ describe GitlabMarkdownHelper do # First issue link expect(doc.css('a')[1].attr('href')). to eq namespace_project_issue_path(project.namespace, project, issues[0]) - expect(doc.css('a')[1].text).to eq "##{issues[0].iid}" + expect(doc.css('a')[1].text).to eq issues[0].to_reference # Internal commit link expect(doc.css('a')[2].attr('href')).to eq commit_path @@ -72,7 +72,7 @@ describe GitlabMarkdownHelper do # Second issue link expect(doc.css('a')[3].attr('href')). to eq namespace_project_issue_path(project.namespace, project, issues[1]) - expect(doc.css('a')[3].text).to eq "##{issues[1].iid}" + expect(doc.css('a')[3].text).to eq issues[1].to_reference # Trailing commit link expect(doc.css('a')[4].attr('href')).to eq commit_path @@ -90,7 +90,7 @@ describe GitlabMarkdownHelper do end it "escapes HTML passed in as the body" do - actual = "This is a <h1>test</h1> - see ##{issues[0].iid}" + actual = "This is a <h1>test</h1> - see #{issues[0].to_reference}" expect(link_to_gfm(actual, commit_path)). to match('<h1>test</h1>') end |