summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-09-18 11:05:27 -0700
committerStan Hu <stanhu@gmail.com>2015-09-20 09:32:35 -0700
commit3b39b648d2f0545f9d3dbd1680f8e9e977893792 (patch)
tree226f43e115522624db74f4dcb064fdd617869306
parent5a8d73243a7b68f2724a6d5f9d482dda24e9dfe4 (diff)
downloadgitlab-ce-3b39b648d2f0545f9d3dbd1680f8e9e977893792.tar.gz
Fix Markdown links not showing up in dashboard activity feed
Closes #2586
-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