diff options
author | Vinnie Okada <vokada@mrvinn.com> | 2015-02-19 20:53:05 -0700 |
---|---|---|
committer | Vinnie Okada <vokada@mrvinn.com> | 2015-02-19 20:53:05 -0700 |
commit | 9e9ce95d62ec4feb76c3ec238dd3189c781f40ce (patch) | |
tree | 28939e566ce29a278cd7ae15e37266aa6a16a17c /spec/helpers | |
parent | 76aad9b76ed756ca9ba2cbcdb399c815e542b3ae (diff) | |
parent | de040ffaaef4ad5ebd93b3f7a237add438dbddd5 (diff) | |
download | gitlab-ce-9e9ce95d62ec4feb76c3ec238dd3189c781f40ce.tar.gz |
Merge branch 'master' into rails-4.1.9
Conflicts:
app/views/dashboard/_project.html.haml
app/views/events/event/_common.html.haml
app/views/explore/projects/_project.html.haml
app/views/groups/_projects.html.haml
app/views/projects/_home_panel.html.haml
app/views/projects/_issues_nav.html.haml
app/views/projects/issues/_discussion.html.haml
app/views/projects/issues/_issues.html.haml
app/views/projects/issues/show.html.haml
app/views/projects/merge_requests/_discussion.html.haml
app/views/projects/merge_requests/_show.html.haml
app/views/projects/milestones/index.html.haml
app/views/projects/notes/_edit_form.html.haml
app/views/shared/_issuable_filter.html.haml
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/gitlab_markdown_helper_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb index 2caeb0dd856..68269ad25a8 100644 --- a/spec/helpers/gitlab_markdown_helper_spec.rb +++ b/spec/helpers/gitlab_markdown_helper_spec.rb @@ -584,7 +584,7 @@ describe GitlabMarkdownHelper do it "should leave code blocks untouched" do allow(helper).to receive(:user_color_scheme_class).and_return(:white) - target_html = "<pre class=\"code highlight white plaintext\"><code>some code from $40\nhere too\n</code></pre>\n" + target_html = "<pre class=\"code highlight white plaintext\"><code>some code from $#{snippet.id}\nhere too\n</code></pre>\n" expect(helper.markdown("\n some code from $#{snippet.id}\n here too\n")). to eq(target_html) @@ -638,6 +638,18 @@ describe GitlabMarkdownHelper do expect(markdown(actual)).to match(expected) end + it "should handle relative urls for a file in master with an anchor" do + actual = "[GitLab API doc](doc/api/README.md#section)\n" + expected = "<p><a href=\"/#{project.path_with_namespace}/blob/#{@ref}/doc/api/README.md#section\">GitLab API doc</a></p>\n" + expect(markdown(actual)).to match(expected) + end + + it "should not handle relative urls for the current file with an anchor" do + actual = "[GitLab API doc](#section)\n" + expected = "<p><a href=\"#section\">GitLab API doc</a></p>\n" + expect(markdown(actual)).to match(expected) + end + it "should handle relative urls for a directory in master" do actual = "[GitLab API doc](doc/api)\n" expected = "<p><a href=\"/#{project.path_with_namespace}/tree/#{@ref}/doc/api\">GitLab API doc</a></p>\n" |