Commit 9e4e1afb authored by Clement Ho's avatar Clement Ho

MR branch link now links to tree instead of commits

parent 31ada792
......@@ -94,7 +94,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
if source_branch_exists?
namespace = link_to(namespace, project_path(source_project))
branch = link_to(branch, project_commits_path(source_project, source_branch))
branch = link_to(branch, project_tree_path(source_project, source_branch))
end
if for_fork?
......
---
title: MR branch link now links to tree instead of commits
merge_request:
author:
......@@ -363,4 +363,17 @@ describe MergeRequestPresenter do
end
end
end
describe '#source_branch_with_namespace_link' do
subject do
described_class.new(resource, current_user: user).source_branch_with_namespace_link
end
it 'returns link' do
allow(resource).to receive(:source_branch_exists?) { true }
is_expected
.to eq("<a href=\"/#{resource.source_project.full_path}/tree/#{resource.source_branch}\">#{resource.source_branch}</a>")
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment