summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-09-21 07:24:19 +0000
committerDouwe Maan <douwe@gitlab.com>2015-09-21 07:24:19 +0000
commit46173ec8ce167c6ecb6ae9bf3b41bb3d3968f948 (patch)
tree9d0c165da76a955c5034069dd247c819331c769f
parentca45e925dfcf5b67fd494bd2009ca7ed0447dacc (diff)
parent3b39b648d2f0545f9d3dbd1680f8e9e977893792 (diff)
downloadgitlab-ce-46173ec8ce167c6ecb6ae9bf3b41bb3d3968f948.tar.gz
Merge branch 'fix-markdown-links-in-dashboard' into 'master'
Fix Markdown links not showing up in dashboard activity feed Closes #2586 See merge request !1353
-rw-r--r--CHANGELOG1
-rw-r--r--app/helpers/gitlab_markdown_helper.rb4
-rw-r--r--spec/helpers/gitlab_markdown_helper_spec.rb11
3 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a1b17e58156..cb3794f7cb6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 8.0.0 (unreleased)
+ - Fix Markdown links not showing up in dashboard activity feed (Stan Hu)
- Fix HTML link that was improperly escaped in new user e-mail (Stan Hu)
- Fix broken sort in merge request API (Stan Hu)
- Bump rouge to 1.10.1 to remove warning noise and fix other syntax highlighting bugs (Stan Hu)
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index 1ebfd92f119..78bf25f55e7 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -45,7 +45,7 @@ module GitlabMarkdownHelper
end
def markdown(text, context = {})
- context.merge!(
+ context.reverse_merge!(
current_user: current_user,
path: @path,
project: @project,
@@ -59,7 +59,7 @@ module GitlabMarkdownHelper
# TODO (rspeicher): Remove all usages of this helper and just call `markdown`
# with a custom pipeline depending on the content being rendered
def gfm(text, options = {})
- options.merge!(
+ options.reverse_merge!(
current_user: current_user,
path: @path,
project: @project,
diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb
index 5639b3db913..b8101ae77ec 100644
--- a/spec/helpers/gitlab_markdown_helper_spec.rb
+++ b/spec/helpers/gitlab_markdown_helper_spec.rb
@@ -38,6 +38,17 @@ describe GitlabMarkdownHelper do
expect(markdown(actual)).to match(expected)
end
end
+
+ describe "override default project" do
+ let(:actual) { issue.to_reference }
+ let(:second_project) { create(:project) }
+ let(:second_issue) { create(:issue, project: second_project) }
+
+ it 'should link to the issue' do
+ expected = namespace_project_issue_path(second_project.namespace, second_project, second_issue)
+ expect(markdown(actual, project: second_project)).to match(expected)
+ end
+ end
end
describe '#link_to_gfm' do